Pcornel
Linux · Containers

Docker

Cheat sheet · https://pcornel.dk/topic.php?topic=2890

Back to the Topic

Answer

Docker is a container engine: dockerd manages images, containers, networks and volumes through containerd and runc, controlled with the docker CLI.

Remember

The docker group grants root-equivalent access. Docker publishes ports with its own iptables rules that can bypass host firewalls (use the DOCKER-USER chain). Clean up with docker system prune carefully.

First checks

  • docker ps -a / podman ps -a — containers and state
  • docker logs <c> — container output
  • docker inspect <c> — configuration, mounts, network
  • docker info — engine, storage driver, cgroup version

Commands

docker run
docker ps
docker logs -f --since 10m web1
docker exec -it web1 sh
docker stats --no-stream
docker inspect web1
docker stop web1 && docker rm web1
docker inspect
docker

Verify in this order

docker CLI → dockerd → containerd → runc starts the container

Where it usually breaks

First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2890

Confirmation

Confirm action

Continue?