Skip to content

lqtruong/docker-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Helpful Docker Commands For Developers To Know

Command Usage Freq
docker run -d -p 80:80 <image> run an application using background (e.g. -d) ✔️
docker container ls -a list all running containers ✔️
docker container rm <container id1> <container id1> remove specific container(s) ✔️
docker container ls -a --filter status=exited --filter status=created remove exited containers
docker container prune --filter "until=12h" remove all images that are created more than 12 hours ago ✔️
docker container stop $(docker container ls -aq) stop all running containers ✔️
docker container rm $(docker container ls -aq) remove all running containers ✔️
docker stop $(docker ps -aq) stop all running containers ✔️
docker rm $(docker ps -aq) remove all running containers ✔️
docker system prune remove all stopped containers, all dangling images, and all unused networks. Use -f or -force to bypass the prompt ✔️
docker system prune --volumes remove all unused volumes
docker image ls list all images
docker image rm <image id1> <image id2> remove specific images ✔️
docker rmi $(docker images -aq) remove all images ✔️
docker image prune [-f, -force] remove dangling images
docker image prune -a remove all unused images
docker image prune -a --filter "until=12h" remove all images that are created more than 12 hours ago
docker volume ls list all volumes
docker volume rm <volume name> remove volume
docker volume prune remove all unused volumes
docker network ls list all networks
docker network rm <network id> remove one or more networks
docker network prune remove all unused network

Releases

No releases published

Packages

No packages published