Docker composer
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. The features are:
- multiple isolated environments on a single host
- preserve volume data when containers are created
- only recreate containers that have changed
- variables and moving a composition between environments
# run containers from
# a docker-compose.yml file in current directory
docker-compose up
# specify file and run containers as daemons
docker-compose -f mydir/my-compose.yml up -d
installation
Follow next steps for install docker-compose on linux
# download the current stable release
sudo curl\
-L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)"\
-o /usr/local/bin/docker-compose
#apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
#test the installation.
docker-compose --version
Docker Desktop for Windows and Docker Toolbox already include Compose along with other Docker apps, so most Windows users do not need to install Compose separately.
Docker Desktop for Mac and Docker Toolbox already include Compose along with other Docker apps, so Mac users do not need to install Compose separately.