install fig ( Fast, isolated development environments using Docker )
$ sudo curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
$ sudo pip install -U fig [ as a Python package ]
$ fig --version
example fig.yml to build two docker images
. is the cwd(current working directory) where fig.yml is located;
./mywebApp is the nodejs app folder where a Dockerfile must exist to build docker image;
./mydb is the database folder where a Dockerfile must exist to build docker image;
*** .dockerignore file cannot include 'Dockerfile' !!!
otherwise, fig build will fail with message 'Can't build a directory with no Dockerfile'
although docker build still succeed.
command: node app.js
$ fig rm [ removes containers ]
$ fig build [ rebuild images ]
$ fig up [ run whole setup again ]
[the correct format]
[the wrong format]
- ./mywebApp: /usr/src/app
the white space after ':' will fail the build
more fig.yml examples for docker
Fig is a python application that helps you run groups of docker containers.
The docker command line interface is awesome, but if you start working with
many containers at once and link them in the development environment,
typing the commands into the command line gets burdensome.
The most pragmatic approach to this problem is creating a bash script ...
--> use 'fig' to simplify the co-working of multiple containers.