docker-compose
gives you lot of command line options to control the environment, you can see this information by running docker-compose - -help
in the command line. We have seen the commands up and down which help setup an environment, in this section we will visit few more helpful commands which provide more granularized control on the environment:
Use the following command to stop all the services within a docker-compose
environment:
docker-compose stop
To start the services, use the following command:
docker-compose start
To start/stop any one service within the compose definition suffix the name of service as shown following:
docker-compose start web
If there is a change in any service's docker file the image should be rebuilt, use the following command to rebuild the images defined using the build
option in the compose
file:
docker-compose build
The following command removes any intermediate containers why rebuilding the image:
docker-compose...