Skip to content

Instantly share code, notes, and snippets.

@danielestevez
Last active August 6, 2021 14:47
Show Gist options
  • Save danielestevez/31f5b8756c76143d33d0d3cc00744b90 to your computer and use it in GitHub Desktop.
Save danielestevez/31f5b8756c76143d33d0d3cc00744b90 to your computer and use it in GitHub Desktop.
Docker cheatsheet
  • Kill all containers for a given <image-name>
  docker rm $(docker stop $(docker ps -a -q --filter ancestor=<image-name> --format="{{.ID}}"))
  • Login to a docker container
  docker exec -it container_id /bin/bash
  • Login to a docker container as root
  docker exec --user 0 -it container_id /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment