Skip to content

Instantly share code, notes, and snippets.

@padewitte
Forked from buonzz/docker-compose-cheatsheet.sh
Created September 22, 2017 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padewitte/c936286d98a53943e2121cc8183f0eaa to your computer and use it in GitHub Desktop.
Save padewitte/c936286d98a53943e2121cc8183f0eaa to your computer and use it in GitHub Desktop.
docker-compose cheatsheet
$ docker-compose up -d # start containers in background
$ docker-compose kill # stop containers
$ docker-compose pull # refresh the local images with the ones of the registry
$ docker-compose up -d --build # force rebuild of Dockerfiles
$ docker-compose rm # remove stopped containers
$ docker ps # see list of running containers
$ docker exec -ti [NAME] bash # ssh to the container
# list all images
docker images
# tag and publishing
docker tag <id> buonzz/name:version
docker login
docker push buonzz/name
# delete image
docker rmi -f <id>
# run an image
docker run yourusername/docker-whale
# view logs
docker logs [OPTIONS] CONTAINER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment