Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
docker-compose command cheatsheet

build everything in the docker-compose.yaml file

docker-compose build

build just one service in docker-compose.yaml file

docker-compose build myservice

run everything in the docker-compose.yaml file

docker-compose up

if you want to run the container in the background (no console output), do this (-d is 'daemon' or background mode):

docker-compose up -d

run one thing in the docker-compose file

docker-compose up myservice

attach to a running service, assuming bash is in the container (will need a new terminal window unless you ran the services in daemon mode)

docker-compose exec myservice /bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.