Docker Cheat Sheet

Docker Cheatsheet:

# pull/update an image
$ docker pull ghcr.io/shaarli/shaarli:release
# run a container from an image
$ docker run ghcr.io/shaarli/shaarli:latest
# list available images
$ docker images ls
# list running containers
$ docker ps
# list running AND stopped containers
$ docker ps -a
# run a command in a running container
$ docker exec -ti <container-name-or-first-letters-of-id> bash
# follow logs of a running container
$ docker logs -f <container-name-or-first-letters-of-id>
# delete unused images to free up disk space
$ docker system prune --images
# delete unused volumes to free up disk space (CAUTION all data in unused volumes will be lost)
$ docker system prune --volumes
# delete unused containers
$ docker system prune

Emergency Docker Downgrade

Docker update screws up Casaos or some other application on your server and you need a quick Docker Downgrade? I had the same issue and just downgraded docker back to 28.5.2 and it instantly fixed the issue. Here are the steps if you need them for ubuntu: Stop Docker sudo systemctl stop docker Install the specific Docker version sudo apt install docker-ce=5:28.5.2-1~ubuntu.24.04~noble \ docker-ce-cli=5:28.5.2-1~ubuntu.24.04~noble \ containerd.io Prevent Ubuntu from automatically upgrading Docker: sudo apt-mark hold docker-ce docker-ce-cli Start Docker again sudo systemctl start docker sudo systemctl enable docker Verify the version docker --version You should see: [Read More]