Last active
August 26, 2022 17:09
-
-
Save 8dcc/54a597f1720d3f26c146d7a76225d2de to your computer and use it in GitHub Desktop.
Docker cheatsheet
This file contains hidden or 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
# Build image | |
docker build -d image_name . | |
# Run image in daemon and remove after exit | |
docker run --name container_name --rm -it -d image_name | |
# Clear images without tag | |
docker rmi $(docker images -f "dangling=true" -q) | |
# Clone an image's tag | |
docker tag image-name:latest image-name:backup2 | |
# Attach to a container | |
docker attack container-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment