Docker Command Line - Gary-Moore/developmentwiki GitHub Wiki

A quick cheatsheet of common Docker commands https://docs.docker.com/engine/reference/commandline/cli/

Run a command in a new docker container

The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command.

docker run <image>
docker run -name <name> <image>

https://docs.docker.com/engine/reference/commandline/run/

Pull image

Pull an image or a repository from a registry

docker pull <image>

https://docs.docker.com/engine/reference/commandline/pull/

List Images

docker images
docker images -a //show all

https://docs.docker.com/engine/reference/commandline/images/

Remove image

Remove one or more images

docker rmi <image>

https://docs.docker.com/engine/reference/commandline/rmi/

List containers

List running containers

docker ps

list all including stopped containers

docker ps -a

https://docs.docker.com/engine/reference/commandline/ps/

Stop running container

docker stop <container>

https://docs.docker.com/engine/reference/commandline/stop/

Remove container

docker rm <container>

Stop and force remove container

docker rm <container> -f

https://docs.docker.com/engine/reference/commandline/rm/

⚠️ **GitHub.com Fallback** ⚠️