Skip to content

Instantly share code, notes, and snippets.

@raphaelchaib
Last active May 23, 2020 21:50
Show Gist options
  • Save raphaelchaib/b2285dd99a6b74143685acdee817a376 to your computer and use it in GitHub Desktop.
Save raphaelchaib/b2285dd99a6b74143685acdee817a376 to your computer and use it in GitHub Desktop.
Docker commands and nice tricks!

Docker commands

Build docker image

docker build -t <image-name:tag> <path|.>

Remove all running containers

docker rm $(docker ps -a -q)

Remove failed builds

docker rmi $(docker images --filter “dangling=true” -q --no-trunc)

Connect to shell of running container

docker exec -it <container-id> sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment