Skip to main content

Managing Docker - A Cheatsheet

· One min read
Enea Krähenbühl

Cheatsheet on commands I have used for my various docker setups. One of them being on a Centos Server and the other one on my NAS running Unraid.

Finding Huge Images / Containers / Volumes

Listing Comtainers with size;

docker ps --size --format "table {{.ID}}\t{{.Names}}\t{{.Size}}"

Listing every object in system, with sizes (Volumes etc.)

docker system df -v

Cleaning up Huge Stuff

Delete all the volumes not attached to a running container:

docker volume prune -f

Clean all the stuff in docker which is not running:

docker system prune -a -f

Force Remove "endpoint" from network

Occurred when container wasn't fully removed. Threw "endpoint with name xx already exists..."

docker network disconnect -f <network> <container>

Run Docker (Rootful Mode) as normal User

Add current user to docker group

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker