Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 1.16 KB

File metadata and controls

59 lines (46 loc) · 1.16 KB

Docker Crash Course

In order to follow this crash course you need to make sure you complete the Docker Engine install for your operating system.

Survival Docker commands

Obtaining a list of currently running containers

$ docker ps

Obtaining a list of all containers running / stopped

$ docker ps -a

Stopping a container

$ docker stop <container name>

Removing a container (has to be stopped)

$ docker rm <container name>

Removing all containers with exited status

$ docker rm -v $(docker ps -a -q -f status=exited)

Inspecting a container

$ docker inspect <container name>

Listing docker images locally available

$ docker images

Pulling an image from the docker hub

$ docker pull redis

Removing docker images

$ docker rmi <image name>

Removing dangling images

$ docker images -f "dangling=true" -q | xargs docker rmi

Resources