Skip to content

Instantly share code, notes, and snippets.

@8dcc
Last active August 26, 2022 17:09
Show Gist options
  • Save 8dcc/54a597f1720d3f26c146d7a76225d2de to your computer and use it in GitHub Desktop.
Save 8dcc/54a597f1720d3f26c146d7a76225d2de to your computer and use it in GitHub Desktop.
Docker cheatsheet
# 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