README
¶
EnvCLI is a simple wrapper that allows you to run commands within ethereal docker containers. You can configure commands to run in docker images within the configuration file. It currently supports the following providers: Docker for Windows, Docker on Linux and Docker Toolbox.
This project aims at dockerizing your development environment, which is the missing counterpart of dockerizing your application.
What merits does this have?
- Reproducible builds (always use the specified version of Node, Go, ...)
- Quick on-boarding (just install Docker and EnvCLI and you can start coding without setting up any other dependencies or spending time on configurations)
- Enforce identical development environments (every developer has the same version of the compilers/gradle/...)
- Never install dependencies manually or deal with leftovers of old versions (containers are ethereal)
- Tools (ex. Ruby -> Changelog generator) can be defined in the
.envcli.ymlwithout installing Ruby or a specific version which might break other tools - Need to use the coreos config transpiler to create a config to boot CoreOS? Just use the system-scoped configuration and use
ctin any directory without installing anything or modifiding your path variables.
. Overview . Installation . Documentation . Credits .
Overview
To use EnvCLI you have to install docker and envcli. (See Installation)
After that you can create the .envcli.yml configuration file for your project.
Example (A single image can provide multiple commands):
commands:
- name: npm
description: Node.js is a JavaScript-based platform for server-side and networking applications.
provides:
- npm
- yarn
image: docker.io/node:10-alpine
When you run envcli run npm init EnvCLI will take the executed command and match it to the Docker Image node:10-alpine based on the provided commands.
What does EnvCLI do?
This project only provides the configuration file and the easy envcli commmand, therefore making it easier to use Docker when development your project. You can do the same without EnvCLI.
Plain Docker:
docker run --rm -it --workdir /go/src/project/ --volume "C:\SourceCodes\golang\envcli:/
go/src/project" golang:latest /usr/bin/env sh -c "go build -o envcli src/*"
With EnvCLI:
envcli run go build -o envcli src/*
Installation
Docker for Windows
- Install Docker for Windows from https://docs.docker.com/docker-for-windows/install/
- Install EnvCLI
Docker for Linux
- Install the default Docker version from your favorite package manager.
- Install [EnvCLI]
32bit
$ curl -L -o /usr/local/bin/envcli https://dl.bintray.com/envcli/golang/envcli/v0.2.1/envcli_linux_386
$ chmod +x /usr/local/bin/envcli
64bit
$ curl -L -o /usr/local/bin/envcli https://dl.bintray.com/envcli/golang/envcli/v0.2.1/envcli_linux_amd64
$ chmod +x /usr/local/bin/envcli
Docker Toolbox (Legacy)
Install EnvCLI
Now you have to configure a docker-machine for envcli: docker-machine create envcli
After that you have to share the drive containing your projects with virtualbox and docker:
- Stop the envcli machine
docker-machine stop envcli - Open VirtualBox
- Rightclick -> Settings on the envcli virtual Machine
- Select Shared Folders and add a machine folder with the Path
- Share the drive which contains your projects (In this example C -> Folder_Path:
C:\, Folder_Name:C_DRIVE) and select the optionsAuto-mountandPermanent - Start the envcli machine
docker-machine start envcli