Skip to content

Instantly share code, notes, and snippets.

@supriya-premkumar
Last active January 4, 2023 11:29
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save supriya-premkumar/1f7d78157429537b1ff2da9c3abbdc58 to your computer and use it in GitHub Desktop.
Save supriya-premkumar/1f7d78157429537b1ff2da9c3abbdc58 to your computer and use it in GitHub Desktop.
Docker Commands

Install Docker

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

Test Docker Version

docker --version

List CLI commands

docker container --help

Check docker installations

docker info or docker version

Execute docker image

docker run <Image Name>

List Docker Images

docker image ls

List Docker containers (running, all, all in quiet mode)

docker container ls

docker container ls --all

docker container ls -aq

Remove image

docker rmi -f <image id>

clean up containers, images, volumes, and networks all in one command

docker system prune

remove all stopped containers

docker container prune

delete all images

docker rmi -f $(docker images -aq)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment