Don't install Node, Go, ... locally - use containers you define within your project. If you have a new machine / other contributors you just have to install docker and envcli to get started.
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 envcli configuration file. It currently supports the following providers: Docker for Windows, Docker on Linux and Docker Toolbox.
What merits does this have?
.envcli.yml
without installing Ruby or a specific version which might break other toolsnpm install x
like you usually do and you won't even notice your commands are executed within docker containers by envcli. Overview . Installation . Documentation . Credits .
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):
images:
- 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.
You can also use envcli install-aliases --scope project
to install the project defined aliases and use npm init
directly - envcli will create a script in your path that will redirect your command to envcli and cause it to be executed within a container.
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/*
With EnvCLI & Aliases:
Can be used by running envcli install-aliases
once.
go build -o envcli src/*
32bit
curl -L -o /usr/local/bin/envcli https://dl.bintray.com/envcli/golang/envcli/v0.7.0/linux_386
chmod +x /usr/local/bin/envcli
64bit
curl -L -o /usr/local/bin/envcli https://dl.bintray.com/envcli/golang/envcli/v0.7.0/linux_amd64
chmod +x /usr/local/bin/envcli
64bit
curl -L -o /usr/local/bin/envcli https://dl.bintray.com/envcli/golang/envcli/v0.7.0/darwin_amd64
chmod +x /usr/local/bin/envcli
You can use envcli
as library in other projects.
go get -u github.com/EnvCLI/EnvCLI