Last active
December 16, 2017 08:09
-
-
Save mostafabahri/4576c40bd867a608db6a4a1c5de029e7 to your computer and use it in GitHub Desktop.
Docker Tips
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
# remove all stopped containers! | |
docker container prune |
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
# show layers info about a a image | |
docker history <image> |
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
If your container needs to write a lot of data, you should consider using a data volume. |
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
# remove container when exited | |
docker run --rm <> | |
# run in background | |
docker run -d <> | |
# -t allocate a psudo-tty so no immediate exit( hence no stopped container) | |
docker run -d -t ubuntu |
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
# remove dangling volumes( volumes attached to no current running container) | |
docker volume rm $(docker volume ls -f dangling=true -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment