Last active
April 16, 2020 14:05
-
-
Save buonzz/054304b3145323c34ed05cb65f1b174f to your computer and use it in GitHub Desktop.
docker-compose cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker-compose up -d # start containers in background | |
$ docker-compose kill # stop containers | |
$ 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 | |
# set the port to expose in host | |
docker run -p 3000 my_image | |
# start new container interactively | |
docker container run -it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love to use the long syntax as is clearer and structured...
Docker documentation reference