Skip to content

Instantly share code, notes, and snippets.

@ToanPV90
Last active February 28, 2020 15:01
Show Gist options
  • Save ToanPV90/92c729a4c1a0bbcec9b066f071b471b5 to your computer and use it in GitHub Desktop.
Save ToanPV90/92c729a4c1a0bbcec9b066f071b471b5 to your computer and use it in GitHub Desktop.
docker cheatsheet
List images
$ docker images -a
Run container with mapping port
$ docker run -d -p {localhost-port}:{container-port} image_name
Removing images according to a pattern
$ docker images -a | grep "pattern" | awk '{print $3}' | xargs docker rmi -f
Removing all images
$ docker rmi $(docker images -a -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment