A Complete Guide to Docker | Cheatsheet
What is docker ? π
Docker is a platform for developing, deploying, and running applications in standardized units called containers. These containers package the application’s code, libraries, and dependencies, ensuring it runs consistently across different environments. Think of it like shipping containers for software, making it easier and faster to move your application around without worrying about compatibility issues.
Why Docker ? π
- Portability: Docker apps run consistently across different environments, from development machines to production servers, avoiding the “it works on my machine” problem.
- Efficiency: Containers are lightweight and share the underlying operating system, making them resource-efficient compared to virtual machines.
- Isolation: Applications in containers are isolated from each other, preventing conflicts and improving security.
- Scalability: Scaling Dockerized applications is easy as you can simply spin up more containers as needed.
- Speed: Docker allows for faster development, testing, and deployment cycles due to its standardized approach.
How to install Docker ? π
Linux π
To install docker on any Linux based distribution, use this code to run the script thst installs docker on your operating system.
curl -sSL https://get.docker.com/ | sh
If you do not like running scripts, check the installation instructions for your Linux distro here .
macOS π
To install docker on your macbook or mac mini or any mac os powered machine, use homebrew by this command brew install --cask docker
or by installing the Docker Desktop
.
Windows OS π
To install docker on Windows 10 or Windows 11, check the instructions on the official docker website here .
I recommend installing docker on WSL2. Use these instructions to install Docker Desktop in the Windows Subsystem for Linux version 2.
Check version π
Use docker version
to show all detailed about the current installed version of Docker on your operating system.
$ docker version
Client:
Cloud integration: v1.0.35+desktop.10
Version: 25.0.3
API version: 1.44
Go version: go1.21.6
Git commit: 4debf41
Built: Tue Feb 6 21:13:26 2024
OS/Arch: darwin/amd64
Context: desktop-linux
Server: Docker Desktop 4.27.2 (137060)
Engine:
Version: 25.0.3
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: f417435
Built: Tue Feb 6 21:14:25 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
But if you want just the version of the docker, use docker version --format '{{.Server.Version}}'
.
$ docker version --format '{{.Server.Version}}'
25.0.3
Container commands π
docker create
creates a container but does not start it.docker rename
rename the container.docker run
creates and starts a container in one operation.docker rm
deletes a container.docker update
updates a container’s resource limits.
So, you can..
docker start
starts a container so it is running.docker stop
stops a running container.docker restart
stops and starts a container.docker pause
pauses a running container, “freezing” it in place.docker unpause
will unpause a running container.docker wait
blocks until running container stops.docker kill
sends a SIGKILL to a running container.docker attach
will connect to a running container.
To get info,..
docker ps
shows running containers.docker logs
gets logs from container. (You can use a custom log driver, but logs is only available forjson-file
andjournald
in 1.10).docker inspect
looks at all the info on a container (including IP address).docker events
gets events from container.docker port
shows public facing port of container.docker top
shows running processes in container.docker stats
shows containers’ resource usage statistics.docker diff
shows changed files in the container’s FS.docker ps -a
shows running and stopped containers.docker stats --all
shows a list of all containers, default shows just running.
To import/export between a docker container and your operating system,..
docker cp
copies files or folders/directories between a container and the local filesystem.docker export
turns container filesystem into tarball archive stream to STDOUT.
To execute a command inside the docker container,..
docker exec
to execute a command in container.
Docker images π
docker images
shows all images.docker import
creates an image from a tarball.docker build
creates image from Dockerfile.docker commit
creates image from a container, pausing it temporarily if it is running.docker rmi
removes an image.docker load
loads an image from a tar archive as STDIN, including images and tags (as of 0.7).docker save
saves an image to a tar archive stream to STDOUT with all parent layers, tags & versions (as of 0.7).
To get info about images,..
docker history
shows history of image.docker tag
tags an image to a name (local or registry).
Cleanup old and obsolete docker images π
You can use docker image prune
to remove all dangling images which are not in use.
$ docker image prune
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: redis@sha256:2e9892520a3d5edc5cf7090056c7ab372b4cc26d8ee8108205977235e92a65c8
deleted: sha256:4733b14e6f4cedc8f3a5069939351055aa4faa6c9e0e8d3add0e641c7617d18e
deleted: sha256:df1913e7ee52dcf15a5a74858c2145c8e1903ca5ca621111718333d96bb3d398
deleted: sha256:302eaa329659c891f5137e6eb5d9a7c0e12a2391270e793b66d70bac1ee7d7cb
deleted: sha256:f9cecf9e9161e5eeb01e2f2c02b8690835529abb34c2950f4357165dcf8c400e
deleted: sha256:df16bb6ee1385d259108594853574ccfac6618251524f1f322e677016350aaba
deleted: sha256:94056d6f643e7d20c1c8d0804b78561d7b3854d6abed4f205e0ccec3fd7994cb
deleted: sha256:24302eb7d9085da80f016e7e4ae55417e412fb7e0a8021e95e3b60c67cde557d
untagged: getmeili/meilisearch@sha256:2a8bda1f316d01d908957928e18b276b6fa00c3bd896414901377b6d618c9fdc
deleted: sha256:2d47191720962da801ef14473dafe09a090629c78fe32df8d6746064723dc22e
deleted: sha256:b042ac4ed43132e0049fff0a890967860a879e05ceef260e6b7fd3657574d7b6
deleted: sha256:eee83123ab2c04d600b97f7d07265cf2b8f53cc9ca1cad2ecf4e04a192925c8e
deleted: sha256:945f073e5c96258fc809f0418d509bb9592b50b15aab8a2676cf5b5fe64dc825
deleted: sha256:97615b9b81c02455b3212af58a44e329ac27321c72aaeb33c5fd8409df11a9f2
deleted: sha256:5bc340f6d4f5a3bc999dfbc790a0bdf0920b9103ef794645034de4260ee4e9c8
untagged: selenium/standalone-chrome@sha256:38bb75fb9c8ad82e1eee6f299b612a09d9c874ecde1d776beddc2eb0bdcb0bea
deleted: sha256:1ac7ccac8ba0f009813fe25278de5ba919f10e636d54531ce48c23474c706f2f
deleted: sha256:10f4fb17c48edfbdb79eeaa5ca94cad1e5171fcf520d49f3917be9f40d2e878c
deleted: sha256:76e5589dce9939872963f73cece5e36cdb383978b9e66481af5dfc31aef4b4b8
deleted: sha256:95b0e4f3714edb62960a4e13f8c054c9809dab4ebdcb6115e2890f840028cde9
deleted: sha256:7c5f760d6db19c7ed60038e5a13cdd9073ab816deedd73f3c01f3995b90989e1
deleted: sha256:eb1ec92eafe5e11a6b83bcf6f1a16eb4a5024baabb3460e1e0b3bcf18d250b05
deleted: sha256:9af256269cd1198f665bb3b02d1774c33e30f44d148dfa318b410c44893148b8
deleted: sha256:cbb212757eb29cffb070861b8052e8943c44614e09300436a841abad2929cbfc
deleted: sha256:429928dfade1d2bd23de19ab660209c4a13c8bf33f9baafb4078bd532196b345
deleted: sha256:18e09d185eb907fbf0a557a94f40ec1af021e1172f88eb09ea4e82e5198010fe
deleted: sha256:7a8626a6b7a442273c7fb28d3110a7c15b0fc6b12757a8de7773b25ef5530ea7
deleted: sha256:fa32e7f5caa1ef16ac93377090fcd8bfa0d5c652fde5d673136af4d875e4b27f
deleted: sha256:7a0ac3af95b12ff9e0333fbd2f88184476c46393f8a7aa56dc92990b624f4582
deleted: sha256:a709ca365e9a3bc353573257325a4300805d6325a9b86d1b6687ed1ad53e2c06
deleted: sha256:0d10483ec093adb3258df04ce1c3b77d144a4066de761a59bb5ed9a829bd258d
deleted: sha256:7825aefca979f4a2b534cd99490595e34aa1a93fd79057568bb41592d3213c94
deleted: sha256:8258ae53da65f9c9ae90aa8be858aaf0ea0ad9429358032a03e439b2fe1ee920
deleted: sha256:fe4c97d9a155bcd92e5ec53e92a03faacb5dba97c5c020e2edd19aa7e9e97747
deleted: sha256:87391c707b7c6a71af6dfb4456ae736b5f2b3903ef0516412b5a62e9f5d1d911
deleted: sha256:deeebce90949366d65acaeae1d383682a8ef8ab8eef7c583449502902634e3b3
deleted: sha256:b0e2461905b58934a0fe82667c1b0b8e6ebb401123052fe3847e25fe09e0070a
deleted: sha256:e2162b38474938bdea40a7b5eddcd700a3a1b1c1caf98c258dfea1799477647f
deleted: sha256:df6491f6dc5e0dfb0e5bce9141cdf337cbef4bc36443738a2c8470cb2b6b9c1f
deleted: sha256:7b3085d0361c7dfaed2c497ec242662feeeb7755c3edcf557157835fc11a3f7f
deleted: sha256:5f8d42ca32302df8b1ce68bcbb159682a794379513692b6cc42b0e07261bc2ed
deleted: sha256:8dbe55f747aa65f3b160afab239182b60424bdad700bd1432f9cb61eaf730ad3
deleted: sha256:e8976f47820bbd3d15915fa4aab68cd7f6f9910e4725933c18075b985e811543
deleted: sha256:718613ce031b4a4a4c4a400ae209a75c32b2faa9b4636d514a722dc39c65e437
deleted: sha256:16a3a585d14e65ee438c2c6cc38046c58c83a790a50cfe68fb43324d25ce05d0
deleted: sha256:fb0604cab45a3499ee04c9bc7e3e46e0376bfcef5b57e40f8fbc5ab9b4bb0288
deleted: sha256:9174882773064aea5b8a9d2f6f9969b925dee70bec7e792feaa3ca4c2a7fed2e
deleted: sha256:29487e3552bd1a9d945543310db92d1ff14970d0e5fdc71f486d8367a2fb308b
deleted: sha256:b1dc4377f1515557f30f7feaf168e8316dc75b2b7fd76c36159d0b1317164f26
deleted: sha256:6021993d84a2d9db89ec74cf44366ae3f2d9f9810f3c77b2bd0cd5ddf14825b1
untagged: getmeili/meilisearch@sha256:94bb999a7c7afa81a64872186b553699213614f705824dd73909a2556fd9b132
deleted: sha256:9e8344e03fced960d79f7bc104b72ca99805b9e829ef192b0cdcbde849821779
deleted: sha256:f2f9933444bd21923f1e197f9e4ec0390778049d5c04a192e17dbda1de1374ad
deleted: sha256:438e5e9031a80c9a213723e43bfe61ae111ee7784b2c3c60002707cb6247d78e
deleted: sha256:a2cf4261d9af664cbefa7fe09a10f4ed41b0998f73a1a0e52ec1e0e21c4a0bd9
deleted: sha256:1cce3450bd49ca7bf0bb55efc3753c99704bd51bf9e9b1c148020ea8244c8503
deleted: sha256:b541d28bf3b491aeb424c61353c8c92476ecc2cd603a6c09ee5c2708f1a4b258
untagged: redis@sha256:0859ed47321d2d26a3f53bca47b76fb7970ea2512ca3a379926dc965880e442e
deleted: sha256:1c1b270ed4205d69c4718b9a31a9dfac8565979ec2f404e4a4102cd053cb7b14
deleted: sha256:17e96dc22bb290787876759e528500f564ec7508025b96da34735bf88c1f4c9d
deleted: sha256:97dbe1900eef057918dcce284a6699f1a2a0c4b44d0df26894d73cdb4044029c
deleted: sha256:d3596a5d002d96a3cc27664ea0a09b73d15691423fe1db4db433584803559e7d
deleted: sha256:98b397c310bc428f59901328b34322788f96a7c9955dd95026a5d00dc245d67c
deleted: sha256:8f2b74175c09cdf2332343e83eb52f26e008c5e4f37d55bf3a8c1c632bebffa6
untagged: mysql/mysql-server@sha256:1a8d2a5584e53a42a43cbd430ae340a36942afee9e14a86624a2cb2d90ce655b
deleted: sha256:5a9594052aecd873d2dc606c7148ac0983ebfbe1604eae9a215071a9cda0fb56
deleted: sha256:4e13c6ba21197af1227b5f8756e6f922e2fc78fc4426e5fe29020c3a233e7d65
deleted: sha256:95ce703aaf1ecd17cf4649c8bc7c5c172abb01e81ed0f2dc094558d8683debe0
deleted: sha256:0000b463a5f1349913099b9d1cb538055c3f313836b4a44441aea0f0dd8ea42b
deleted: sha256:00e8ddc2f20e94154458e959b058fa813ee0c61ac4bd72e489482d40339bc06c
deleted: sha256:e2f249a3d350f2ac61d07dac50a5afc7806d5e2c6f4d702634010817e3e66fd4
deleted: sha256:c4b2de44f1992d196584ad41b29ff2868a55598b2c5b5a46739376aa2696eab0
deleted: sha256:d2db75568ee66eaf993c0287d9d570a94ead0b249cdb311d21ff14cd80fd03e4
deleted: sha256:3eca945cf19f1d55bde2a591a10e7a6af1be5ea4d64a385d71a6efeaa02f5965
Total reclaimed space: 2.016GB
That freed up 2GB of storage on my operating system.
We’ll talk about more commands to cleanup and delete obsolete things below.
Load/Save docker image π
Load an image from file:
docker load < my_image.tar.gz
Save an existing image:
docker save my_image:my_tag | gzip > my_image.tar.gz
Import/Export container π
Import a container as an image from file:
cat my_container.tar.gz | docker import - my_image:my_tag
Export an existing container:
docker export my_container | gzip > my_container.tar.gz
Difference between loading a saved image and importing an exported container as an image π
Loading an image using the load command creates a new image including its history. Importing a container as an image using the import command creates a new image excluding the history which results in a smaller image size compared to loading an image.
Networks in Docker π
docker network create NAME
Create a new network (default type: bridge).docker network rm NAME
Remove one or more networks by name or identifier. No containers can be connected to the network when deleting it.docker network ls
List networks.docker network inspect NAME
Display detailed information on one or more networks.docker network connect NETWORK CONTAINER
Connect a container to a network.docker network disconnect NETWORK CONTAINER
Disconnect a container from a network.
Docker Registry & Repository π
docker login
to login to a registry.docker logout
to logout from a registry.docker search
searches registry for image.docker pull
pulls an image from registry to local machine.docker push
pushes an image to the registry from local machine.
Dockerfile π
The configuration file which sets up a Docker container when you run docker build
on it. See docker docs on the configuration file here
.
- use .dockerignore file.
FROM
Sets the Base Image for subsequent instructions.LABEL
Set the Author field of the generated images.RUN
execute any commands in a new layer on top of the current image and commit the results.CMD
provide defaults for an executing container.EXPOSE
informs Docker that the container listens on the specified network ports at runtime. NOTE: does not actually make ports accessible.ENV
sets environment variable.ADD
copies new files, directories or remote file to container. Invalidates caches. AvoidADD
and useCOPY
instead.COPY
copies new files or directories to container. By default this copies as root regardless of the USER/WORKDIR settings. Use--chown=<user>:<group>
to give ownership to another user/group. (Same for ADD.)ENTRYPOINT
configures a container that will run as an executable.VOLUME
creates a mount point for externally mounted volumes or other containers.USER
sets the user name for following RUN / CMD / ENTRYPOINT commands.WORKDIR
sets the working directory.ARG
defines a build-time variable.ONBUILD
adds a trigger instruction when the image is used as the base for another build.STOPSIGNAL
sets the system call signal that will be sent to the container to exit.LABEL
apply key/value metadata to your images, containers, or daemons.SHELL
override default shell is used by docker to run commands.HEALTHCHECK
tells docker how to test a container to check that it is still working.
Docker Volumes π
docker volume create
creates a new volume/drive.docker volume rm
removes a volume/drive.docker volume ls
lists all volumes/drives.docker volume inspect
get all info about volumes/drives.
You can map MacOS host directories as docker volumes like this:
docker run -v /Users/mbp/projects/test_app/src:/src
Docker-Compose π
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your applicationβs services. Then, with a single command, you create and start all the services from your configuration.
By using the following command you can start up your application:
docker-compose -f <docker-compose-file> up
You can also run docker-compose in detached mode using -d
flag, then you can stop it whenever needed by the following command:
docker-compose stop
Remove obsolete docker-related things π
To optimize your local storage space, you can delete Docker things which are not in use.
a summary of the space currently used by different docker objects π
I use docker system df
to show all Docker objects consuming local storage space.
$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 19 4 9.262GB 9.021GB (97%)
Containers 7 0 3.91GB 3.91GB (100%)
Local Volumes 33 0 1.558GB 1.558GB (100%)
Build Cache 136 0 3.98GB 3.98GB
If you want to show more storage space consumption details, add -v
flag to the command.
$ docker system df -v
Images space usage:
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
<none> <none> 7eb764bcde38 10 days ago 1.07GB 1.069GB 0B 1
tesstrain latest f7d34a028bc8 10 days ago 1.07GB 1.069GB 0B 3
<none> <none> 733f85f0cfd5 10 days ago 1.08GB 835.2MB 241MB 1
sail-8.1/app latest 5aebc0769ff7 11 days ago 936MB 0B 935.7MB 0
selenium/standalone-chrome latest 40b121a3cd73 12 days ago 1.23GB 0B 1.229GB 0
sail-8.3/app latest 7b83b24ea229 5 weeks ago 1.23GB 0B 1.227GB 0
memcached alpine fba850e40285 7 weeks ago 14.8MB 7.377MB 7.443MB 0
redis alpine 20658529aaf6 7 weeks ago 46.1MB 7.377MB 38.7MB 0
postgres 15 d366292ba654 8 weeks ago 419MB 0B 419.3MB 0
getmeili/meilisearch latest b93c6bfb0152 2 months ago 137MB 0B 136.5MB 0
kartbusinessapi-app latest bcc4f98fe4e7 3 months ago 821MB 0B 820.5MB 0
postgres latest fbd1be2cbb1f 5 months ago 417MB 0B 417MB 0
sail-8.2/app latest 6d7bbc81efe4 9 months ago 917MB 77.81MB 839.4MB 0
ubuntu latest 3b418d7b466a 10 months ago 77.8MB 77.81MB 0B 2
axllent/mailpit latest 13787536b69f 10 months ago 24.5MB 0B 24.46MB 0
laravelsail/php82-composer latest 278039c7a819 12 months ago 532MB 0B 532.1MB 0
mysql/mysql-server 8.0 1d9c2219ff69 13 months ago 496MB 0B 495.9MB 0
mysql 5.7 459651132a11 19 months ago 429MB 0B 428.9MB 0
mailhog/mailhog latest 4de68494cd0d 3 years ago 392MB 0B 392MB 0
Containers space usage:
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
e207702fb99d tesstrain "bash" 0 1.22GB 10 days ago Exited (0) 9 days ago strange_poincare
02629285a1b7 7eb764bcde38 "bash" 0 1.22GB 10 days ago Exited (0) 10 days ago tender_spence
9c32dcd5482f tesstrain "bash" 0 1.21GB 10 days ago Exited (130) 10 days ago goofy_mclaren
e880f29703ab tesstrain "bash" 0 135MB 10 days ago Exited (127) 10 days ago gallant_leavitt
1ff7a0b3fee7 733f85f0cfd5 "bash" 0 133MB 10 days ago Exited (2) 10 days ago hungry_bose
88633b270a69 ubuntu "/bin/bash" 0 17B 9 months ago Exited (0) 9 months ago mystifying_ellis
2e52f25eec2b ubuntu "/bin/bash" 0 51B 9 months ago Exited (0) 9 months ago eloquent_borg
Local Volumes space usage:
VOLUME NAME LINKS SIZE
paymentsystem_sail-mysql 0 196.3MB
076cb6e7af0c19054dcf1a5726b7822401a9acaad319dc249d980717fcff456d 0 49.51MB
900f9099c92a0f797794373cbe74380794d508ee4a0b39314e31abfe730ce2a8 0 0B
e3d6043220bc4df640fb32a63dc4be6c72cf19777f7d25432951677c4a1ff51c 0 49.51MB
f514e9c1f9fd633af9b82ca146a6657245753727e4a88912fd1d761a42281c2d 0 49.51MB
kartbusinessapi_postgres-data 0 47.59MB
d2f3711842e60407ce582c93ee3cd927a0caa14f724296b5fa18f6ce3e659f3a 0 0B
lokastoresweb_sail-redis 0 89B
sohagstores-i3_sail-mysql 0 190.8MB
99ffb88a209d64cc3c0907c30723f2f19533942aa600e31a19ce3d30e4a7b4d9 0 49.51MB
b847bdb03d98d37f6d09e606c8cc3070e8000773e8d4f205b09987f901642dab 0 49.51MB
d1175b1994d8144b8fcfa0c7ec3d6486161393b8a366372cb7f02a2ec6a9005d 0 0B
fbff9ca11cba046e064dfb8aee42e0bd903040d3e949c4bcc55a4f49e8f21e37 0 49.51MB
lokastoresweb_sail-meilisearch 0 98.34kB
51ed2e487052e057a800d5aa3c61e81da0ff92fbb017469b1a42a1b18a537004 0 49.51MB
6712d97e2713f38a510268c0c0c122daea4bf4b7d1d3a602bc7dceca1ae4d195 0 0B
97181cdcf47789e463ab9a024463ec69cdff1014ba116131a0b0a7e5aa6b4b76 0 0B
kartbusiness-docker_sail-mysql 0 231.8MB
lokastoresweb_sail-mysql 0 247.9MB
da60c5293f4927304b5b3996c2fd809977ce43814c23c13b58a2506fcd903d14 0 0B
e06de51a763e9c4e6d4c6949066884759cba5d5e7283eb031278297b91dd04f6 0 0B
ed2f78ec11ffcfc5adf8f012d620c0f5ad0f8b2889184ada6f531c8edee29e35 0 49.51MB
kartbusiness-docker_sail-redis 0 88B
c6175dab16d541677ba35f8f862830f52adceb150848284fcbc3af87be13f63d 0 0B
03809969191a91f611243ab70cd85a761265e1a5fa04a28f47a8cf6fdc4447ac 0 0B
2cce21aa5eb7162987a5dc4996d68671d639b7d98af73f5d2e93444b9cf094ba 0 49.51MB
84c279c2204ac9c8922df97016cc956af968333ed8ebcc73173a6876ebaf8796 0 0B
b32bd5e19ee9c6125d4ce2cafc53007072da0a40a94731cd3fb3a4f5a1c200ee 0 0B
c26fe4260828a01e22f3b0b61810309e44fc39bb820d154e3aac14d5d974d493 0 49.51MB
8d5e407b94ca24ae2e7a805368b1563c1c71a6eaeed1940d639da0a1f07dbea3 0 49.51MB
f2f9744061377d4acd7e29e5b1f989efc4ebe25e5401c63d50ba6729e973b8e8 0 49.51MB
f8d682b55b2f5451f28341b54ed40c722f43db6d3e580150afc35cda28ee3682 0 49.51MB
kartbusiness-docker_sail-meilisearch 0 94.25kB
Build cache usage: 3.98GB
CACHE ID CACHE TYPE SIZE CREATED LAST USED USAGE SHARED
p3luk8gmpph0 regular 656MB 20 months ago 20 months ago 1 false
uqkj6n3ya1n7 regular 442kB 20 months ago 20 months ago 1 false
v2c3j9cb19hu regular 374B 20 months ago 20 months ago 1 false
jlzxk3cp2ibc regular 291B 20 months ago 20 months ago 1 false
89h91a688g1p regular 5.53MB 20 months ago 20 months ago 1 false
lcaof0lpdkin regular 0B 20 months ago 20 months ago 1 false
fhrhc8f7go5p regular 1.7kB 20 months ago 20 months ago 1 false
17s3u8im7mt1 regular 78B 20 months ago 20 months ago 1 false
x83vja1fi2ur regular 4B 20 months ago 20 months ago 1 false
qhcf54i39jwt regular 291B 20 months ago 20 months ago 1 false
1vabbj6fnzj5 regular 27B 19 months ago 19 months ago 1 false
3000z3r73l1j regular 0B 20 months ago 19 months ago 2 false
pflumri0tm5i regular 674MB 19 months ago 19 months ago 1 false
nrg1he1x4nlj source.local 2.86kB 19 months ago 19 months ago 2 false
tl7tjp4zizpa source.local 0B 19 months ago 19 months ago 2 false
waiu31txf1iq source.local 748B 19 months ago 19 months ago 2 false
wpkftew5h4ej regular 5.56MB 19 months ago 19 months ago 2 false
wg1mw273e8i9 regular 4B 10 months ago 10 months ago 1 false
2e05wbfeesox regular 442kB 10 months ago 10 months ago 1 false
ze2k4gjfr1lz regular 296B 10 months ago 10 months ago 1 false
kjkwfum66z96 regular 374B 10 months ago 10 months ago 1 false
wwyztbinrxja regular 296B 10 months ago 10 months ago 1 false
oz5m3omzdnm2 regular 1.77kB 10 months ago 10 months ago 1 false
o91bxirahd94 regular 110B 10 months ago 10 months ago 1 false
bh6z25nin7v0 regular 5.68MB 10 months ago 10 months ago 1 false
0ok8zep3r64q regular 0B 10 months ago 10 months ago 1 false
lct1kxqlkbat regular 0B 10 months ago 10 months ago 1 false
x2a0nsf5s5sy regular 832MB 10 months ago 10 months ago 1 false
i06d8gv0ia81 source.local 780B 10 months ago 9 months ago 2 false
hajuavlau97f regular 5.68MB 9 months ago 9 months ago 1 true
acycmr8oty0m regular 296B 9 months ago 9 months ago 1 true
k0ke768050ph regular 374B 9 months ago 9 months ago 1 true
ts69vyp18f7m source.local 2.69kB 10 months ago 9 months ago 3 false
o2q512vx0zn4 source.local 0B 10 months ago 9 months ago 3 false
np0kkq6c1i5g regular 833MB 9 months ago 9 months ago 1 true
oz2vifyvxrz1 regular 110B 9 months ago 9 months ago 1 true
5mal4355wup1 regular 296B 9 months ago 9 months ago 1 true
ow1jdfxqms0u regular 1.77kB 9 months ago 9 months ago 1 true
vk6nnyqaa259 regular 442kB 9 months ago 9 months ago 1 true
og5oge6x9ja5 regular 27B 9 months ago 9 months ago 1 true
3r83rpf5x142 regular 0B 9 months ago 9 months ago 1 true
ix6kwcafddi4 regular 0B 9 months ago 9 months ago 1 true
slm978l6qr9p source.local 2.86kB 20 months ago 9 months ago 7 false
xxbsyrnx61oo source.local 0B 20 months ago 9 months ago 7 false
yp68yvcpnrdm source.local 743B 20 months ago 9 months ago 2 false
pqff5smai7c1 regular 0B 4 months ago 4 months ago 1 false
exlkrew26rqc regular 27B 4 months ago 4 months ago 1 false
oui7126fikhn regular 27B 4 months ago 4 months ago 1 false
vgnwerh1mlh6 regular 0B 4 months ago 4 months ago 3 false
zkov73xcbqyi regular 27B 4 months ago 4 months ago 1 false
9at89m0u67pt regular 27B 4 months ago 4 months ago 2 false
bjqjlr8hhvx8 regular 27B 4 months ago 4 months ago 1 false
nars76jy0ryy regular 110B 4 months ago 4 months ago 1 false
or0w916zumvu regular 5.57MB 4 months ago 4 months ago 1 false
l008bn9ckc47 regular 1.77kB 4 months ago 4 months ago 1 false
owutmji50zag regular 442kB 4 months ago 4 months ago 1 false
8j740lfuhnr3 regular 296B 4 months ago 4 months ago 1 false
y0utah72s717 regular 374B 4 months ago 4 months ago 1 false
5u7ixmtabqf0 regular 296B 4 months ago 4 months ago 1 false
j9k7trzh8qmj regular 27B 4 months ago 4 months ago 1 false
74iv30pyd84z regular 858MB 4 months ago 4 months ago 1 false
elsu5xohkgp2 regular 0B 3 months ago 3 months ago 1 true
letrt2pmqyh1 regular 0B 3 months ago 3 months ago 1 true
vwy425gvsa9n regular 0B 3 months ago 3 months ago 1 true
0yyql9isd8c6 regular 0B 3 months ago 3 months ago 1 true
ikyg59b6hoam regular 0B 3 months ago 3 months ago 1 true
fmrwn811xdgi source.local 0B 3 months ago 3 months ago 8 false
glo6y7hgyb46 regular 0B 3 months ago 3 months ago 1 true
p4nw7i26g2c4 regular 5.95MB 3 months ago 3 months ago 1 true
uijkyxyzqvat regular 0B 3 months ago 3 months ago 1 true
odj009vvwav0 source.local 0B 3 months ago 3 months ago 8 false
erxyrnsd2cwv regular 374B 7 weeks ago 7 weeks ago 1 false
lzfonjljn2lv regular 296B 7 weeks ago 7 weeks ago 1 false
jst2nr8200mm regular 0B 7 weeks ago 7 weeks ago 1 false
9gxyl81586mq regular 296B 7 weeks ago 7 weeks ago 1 false
j6et6pyf0n57 regular 27B 7 weeks ago 7 weeks ago 1 false
tkj1gnol6e3y regular 442kB 7 weeks ago 7 weeks ago 1 false
rgvhznjoos4e regular 0B 7 weeks ago 7 weeks ago 1 false
4zis2b9npngc regular 865MB 7 weeks ago 7 weeks ago 1 false
n0mrx5va2rao regular 5.58MB 7 weeks ago 7 weeks ago 1 false
woc9v3lzw776 regular 1.77kB 7 weeks ago 7 weeks ago 1 false
bked0b9n9avx regular 110B 7 weeks ago 7 weeks ago 1 false
j7m0mqgf7c0i regular 27B 7 weeks ago 6 weeks ago 12 false
7kjszoof58vu regular 0B 5 weeks ago 5 weeks ago 1 true
z05lckj731s5 regular 0B 5 weeks ago 5 weeks ago 1 true
it81mlbe1zm4 regular 27B 5 weeks ago 5 weeks ago 2 false
wtbi23oljmmn regular 1.77kB 5 weeks ago 5 weeks ago 1 true
xktjw90fk5fp regular 5.78MB 5 weeks ago 5 weeks ago 1 true
t0pxn0xb4egy regular 296B 5 weeks ago 5 weeks ago 1 true
2nd04lmijuia regular 314B 5 weeks ago 5 weeks ago 1 true
pqlxqpfkm5e8 regular 27B 5 weeks ago 5 weeks ago 1 true
21rgx0acaey5 regular 296B 5 weeks ago 5 weeks ago 1 true
jaxqyrnxdk2f regular 442kB 5 weeks ago 5 weeks ago 1 true
prs40tve0z9h regular 110B 5 weeks ago 5 weeks ago 1 true
jka2jdbwha3f source.local 3.17kB 7 weeks ago 5 weeks ago 15 false
uet9xdmmu8mf source.local 720B 7 weeks ago 5 weeks ago 15 false
mhvz1qm1txa1 source.local 0B 7 weeks ago 5 weeks ago 15 false
bsm4ww23shf5 regular 1.14GB 5 weeks ago 5 weeks ago 1 true
lh3fu02hr66n regular 0B 4 weeks ago 4 weeks ago 1 false
prvv8s8f2k3p regular 0B 4 weeks ago 4 weeks ago 1 false
kzjt57ymlfec regular 0B 4 weeks ago 4 weeks ago 1 false
vfrxdd3jw5xx regular 0B 4 weeks ago 4 weeks ago 1 false
j7k3o6miyqvd regular 0B 4 weeks ago 4 weeks ago 1 false
s1666sfo48hz regular 0B 4 weeks ago 4 weeks ago 1 false
39mjvuhuejv8 regular 193B 4 weeks ago 4 weeks ago 3 false
lt7kjdck0jkf source.local 8.69MB 4 weeks ago 4 weeks ago 3 false
czart0fl6va1 source.local 0B 4 weeks ago 4 weeks ago 3 false
uaqwiornzak8 source.local 247B 4 weeks ago 4 weeks ago 4 false
704ghbfp3m9e regular 296B 11 days ago 11 days ago 1 true
08dxmewlqitj regular 374B 11 days ago 11 days ago 1 true
17mq0yiz3wcj regular 296B 11 days ago 11 days ago 1 true
2qo4lljr7c36 regular 0B 11 days ago 11 days ago 1 true
j20pjqx2uwsy regular 852MB 11 days ago 11 days ago 1 true
p3paxcdrjv83 regular 1.77kB 11 days ago 11 days ago 1 true
f51ji8ljig71 regular 5.58MB 11 days ago 11 days ago 1 true
2j2zbpivdxx7 source.local 0B 4 months ago 11 days ago 9 false
5azd2gsqo9hn regular 0B 11 days ago 11 days ago 1 true
lzwykxwrohf9 regular 27B 11 days ago 11 days ago 1 true
pmibb5tehdvu regular 110B 11 days ago 11 days ago 1 true
l7d0xa8dik50 source.local 2.71kB 4 months ago 11 days ago 9 false
ba5r3s20wqz9 regular 442kB 11 days ago 11 days ago 1 true
eder3mcwq8p3 source.local 780B 4 months ago 11 days ago 9 false
m3soj16cmanl regular 711MB 10 days ago 10 days ago 1 true
5yn5ty33k8mt regular 26.7MB 10 days ago 10 days ago 1 true
elkpti8d53bn exec.cachemount 0B 10 days ago 10 days ago 3 false
jeg3kthhdclv regular 19.8MB 10 days ago 10 days ago 1 true
k5ob4001ak80 regular 220MB 10 days ago 10 days ago 1 true
pd1nfhfjiaha regular 0B 10 days ago 10 days ago 3 true
sfg1v430o38q regular 15.4MB 10 days ago 10 days ago 1 true
qbpwhbovne62 regular 5.73MB 10 days ago 10 days ago 5 true
ngif0srz6zle exec.cachemount 56.2MB 10 days ago 10 days ago 4 false
z74hjninsztp regular 8.63MB 10 days ago 10 days ago 1 true
po09m3397ivo regular 220MB 10 days ago 10 days ago 1 true
pd29ue60bz2u regular 5.73MB 10 days ago 10 days ago 4 true
i5f7g5847jy9 source.local 1.22kB 10 days ago 10 days ago 11 false
eqqpvx6lh8e2 source.local 0B 10 days ago 10 days ago 11 false
delete ALL unused data π
You can use this command docker system prune
to delete containers stopped, volumes without containers and images with no containers.
$ docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- unused build cache
Are you sure you want to continue? [y/N] y
Deleted Containers:
e207702fb99dcc3a6fde9d3d2c4a752d958ee518c0c671452adb86ab519cb241
02629285a1b75ed8288fcd3347527e2aae0b1a2b3e2d3ec179c3ed89864a93df
9c32dcd5482fc8672842e3ce6e01d59dd8f6ca5e38efac1df2f6373619bb262e
e880f29703abae74c6ba6edf922353b737d20f87ee17ba13aed70e32038ba4aa
1ff7a0b3fee761d03d0ec598e7ffa2caae914a639f795b9887797b12dade09b5
88633b270a69dff60e30f01746e66f024d51a65fa142eec58fe1c147021db159
2e52f25eec2bff5c6a3016b1ab2a029bbb904e47039131d1072dc87222ace38d
Deleted Images:
deleted: sha256:733f85f0cfd5ed8968895d3ce30f24b442e519d5e2c5aa0639516f31cac4655a
deleted: sha256:7eb764bcde3848cf716defa3ec413e46ecaa75bdf47fa626e17b75777b9b7c4c
Deleted build cache objects:
odj009vvwav0hxf43y129ly5f
o2q512vx0zn4f3kgp81n73jcy
czart0fl6va1fqtxiagqah5fm
jka2jdbwha3f8ej04rkjh67c0
wpkftew5h4ejbul87b1nkf925
qbpwhbovne62ux42cntegd6ry
zkov73xcbqyik49xjy1mtpkfi
ts69vyp18f7mkv2vf73w3r616
nrg1he1x4nlj870ueko77o0kh
eder3mcwq8p3of61pyh8n9hdg
ngif0srz6zleiin9n5aftu193
slm978l6qr9psxnq9bj2ishl9
2j2zbpivdxx7fqnjdh09muvw6
exlkrew26rqcnfpdqta2ze70i
eqqpvx6lh8e2ew21bw5jykn6w
i5f7g5847jy9mb4f6902cptx0
i06d8gv0ia81d1ks7k00zpsku
39mjvuhuejv8rqi739n6qlskk
jlzxk3cp2ibcftf3eftcjy9sd
wwyztbinrxja1l7tc5px53gcb
j7m0mqgf7c0iiizs25wej5lhm
l7d0xa8dik50o25x3t0vg00px
mhvz1qm1txa1yxzrwadbl0ysa
bjqjlr8hhvx8melhq4v0zze40
lzfonjljn2lvbxb4lgr1fgem8
9at89m0u67ptavvhs57ouzaxy
fmrwn811xdgis6dd8b8fp8ts6
uet9xdmmu8mfedektj8g6dqvh
waiu31txf1iqckdytx3mt8op8
tl7tjp4zizpa6jxlndgftsiyo
oui7126fikhnje1rx3yeegty3
lt7kjdck0jkfsbmlm8rizq1ti
xxbsyrnx61oovb3njzg3uuj20
uaqwiornzak8jukudm8rpxcqv
it81mlbe1zm4na5i6e3fh579r
5u7ixmtabqf07aabr5xhkj9dl
yp68yvcpnrdmftd6sk13tskvq
elkpti8d53bn0hsugx82xdyq0
nars76jy0ryydsij4yrkhvuph
o91bxirahd944gem5lzn70o1x
k5ob4001ak80pgvydqjvqyfj6
pflumri0tm5idhofgt4cuzdw4
17s3u8im7mt1tmrbl4sp5u2zr
bked0b9n9avxmxm64xj3y5eg6
s1666sfo48hzrw52pmlmutyvp
y0utah72s717wsynvk0rflb3h
v2c3j9cb19hub8ki63zenl1eu
1vabbj6fnzj5vxy54s1ttpxmr
kjkwfum66z96tlwvov29332wx
sfg1v430o38qqn7zhovkp2gc2
j7k3o6miyqvdnqurzft9fc5x3
erxyrnsd2cwvn6a8p19v24sha
vfrxdd3jw5xxeztozavam9i1s
ze2k4gjfr1lzviqhydq4apol6
qhcf54i39jwtkgu2rf3qxa7ix
8j740lfuhnr3dcfjw397uy3nu
9gxyl81586mq68noj02qadu89
kzjt57ymlfecspvz4oq5gdcvy
owutmji50zagqfw3xlohsiho9
tkj1gnol6e3yye1usgv0sh680
uqkj6n3ya1n7wwzp521cfxwhn
2e05wbfeesoxc3mx7aca95zhv
oz5m3omzdnm2yais1lmgkjmzo
l008bn9ckc47xs7kcmta6g2mh
prvv8s8f2k3pgi099fxmwe8m9
fhrhc8f7go5pzykas3lhl49kd
woc9v3lzw776mw51nefbyyxvk
n0mrx5va2rao26la5tcxxw8rr
89h91a688g1pfxp6bvo3vj6pt
or0w916zumvus1evqeuogzgde
bh6z25nin7v0o08lptmj1z7xv
lh3fu02hr66n2zx27icnqv9tv
74iv30pyd84z8232nt5a1ve4q
4zis2b9npngcomg46gfthlcse
p3luk8gmpph00z325xcdweckv
x2a0nsf5s5syebkb6olzvc8n8
j6et6pyf0n57pcuq8vej6gjz1
x83vja1fi2urgjdcydopw7qgt
wg1mw273e8i9fwvf1gvebbivj
j9k7trzh8qmjb6gcumkc4ghag
lct1kxqlkbateizyrsrulj2gr
jst2nr8200mmc3c7aep8xv9p2
3000z3r73l1jnp2l4hv4q5c23
vgnwerh1mlh613uxdq2as7vkn
rgvhznjoos4eubvkkugbwf24j
pqff5smai7c1p41ywqmy5eerw
0ok8zep3r64qto4iwl5tccx6u
lcaof0lpdkinf2heg4ezzeg3f
Total reclaimed space: 8.131GB
That command freed up 8GB of local storage space on my own macbook.
delete all stopped containers π
You can use docker container prune
to delete all stopped docker containers.
delete all volumes without associated containers π
You can use docker volume prune
to delete all volumes without associated containers.
remove unused networks π
Use docker network prune
to delete all unused networks. Unused network is not connected to any containers or do not have any containers attached to them.
I hope this post helps you. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .