846 B
846 B
Docker
Handling Builds
Building a Docker image
sudo docker build -t tag/name .
NOTE: The
-t
-tag stands for Tag followed by the Tag-Name and the.
is the location of the Dockerfile.
Handling Images
List all images
sudo docker images
Delete all unused Images
sudo docker image prune -a
Handlicng Containers
List all running containers
sudo docker ps
List all containers
sudo docker ps -a
Delete a running container
sudo docker rm -f <containername>
NOTE: The
-f
-tag stands for force-command
List all Containers with Exited
Code
sudo docker ps -q -f status=exited
Delete all containers with Exited
Code
sudo docker rm $(sudo docker ps -q -f status=exited)