Created
October 10, 2025 15:34
-
-
Save Vicfred/bfa736496657b99bf0625cf3c791ba3c to your computer and use it in GitHub Desktop.
Revisions
-
Vicfred created this gist
Oct 10, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # Docker ```bash docker system df # See what's eating space docker ps docker ps -a docker container ls docker stop <container> # SIGTERM, then SIGKILL after 10s (use -t N to change) docker kill <container> # immediate SIGKILL docker system prune # Remove stopped containers, dangling images, unused networks docker system prune -a --volumes # Same as above plus all images not used by any container and unused volumes (volumes may contain DB/data) docker image prune # Only dangling docker image prune -a # All docker container prune # Stopped containers docker volume prune # Only dangling volumes docker images -a # List images docker rmi $(docker images -q) # remove all images not in use; add --force as needed docker volume ls docker volume ls -qf dangling=true | xargs -r docker volume rm # Remove volumes (data loss if used) docker network ls docker network prune ``` # Docker Compose ```bash docker compose up docker compose ps # see running services docker compose stop # graceful stop all services in this stack docker compose down # stop + remove containers (keeps volumes unless --volumes) ```