Docker Cheat sheet Series : Docker Compose

Part 6

pradeep padmarajaiah
1 min readJun 20, 2018

docker-compose up
execute the docker compose file in the current directory

docker-compose down
Stop and remove containers, networks, images, and volumes

docker-compose stop
Stop the services

docker-compose up -scale <service_name>=<number_of_times>
Execute the compose file. Run the service called service_name for a times number_of_times

docker-compose.yml file

version:
Current version of docker compose

volumes:
Define the volumes of the docker compose

services:
Define the services of the docker compose

images:
Images that of the current services

volumes:
Define the volumes of the docker compose

container_name
name of the container

build
Build it from the mentioned directory. If not specified, it will pull from docker hub.

port
Map host to container host

environment
Define all the environment variables

--

--