The Docker commands I use the most, grouped by task

This article was reworked in November 2026. The first version from 2019 had a few commands that no longer match how Docker behaves, and it used the old docker-compose binary.

I have been working with Docker containers since 2019, and a handful of commands cover almost everything I do day to day. This is my list, grouped by what I am trying to get done, with the details that tripped me up at least once.

Images

Running containers

Looking inside a container

Copying files

docker cp works with running and stopped containers.

Volumes

Cleaning up

This is where I see most mistakes, because each prune command removes something different.

Docker Compose

Compose is now part of the Docker CLI and is called with docker compose, with a space. The old standalone docker-compose binary is no longer updated, so if a tutorial still uses it, drop the hyphen.

For every option of these commands, the Docker CLI reference is the place to look.

comments powered by Disqus