Run Docker-in-Docker safely for CI.
AdvancedScenarioRuntimes: containerd, OCI, rootless and Podman
Answer
Situation read → Jobs need to run docker build and docker run.
What I'd do → Prefer socket-less builds (BuildKit, Kaniko). If DinD is needed, use docker:dind-rootless or Sysbox runtime so inner Docker does not require --privileged, give each job its own ephemeral daemon, and use TLS (DOCKER_TLS_CERTDIR=/certs).
Why → Privileged DinD is host-root equivalent.
Interview tip → Socket mounting shares the host daemon; DinD isolates it but is privileged.
More on Runtimes: containerd, OCI, rootless and Podman
Explain the path from `docker run` to a running process.IntermediateKubernetes removed dockershim. What does that mean for your Docker-built images?BeginnerRun rootless Docker for developers on a shared Linux box.IntermediatePodman vs Docker: when would you pick Podman?IntermediateRun a Podman container as a systemd service.IntermediateWhat is the OCI and which specs does it define?Beginner