Docker and containers
Containers, images, networking, compose. No magic: what mounts where.
Basics
How a container differs from a VM and from emulation. Namespaces and cgroups in short, and what actually runs under the hood in Docker.
docker run and its flags, ps/logs/exec, how to get inside a running container, and how an image differs from a container.
Image vs container, layers plus copy-on-write, tags vs digests, why latest is a trap, what a registry is.
FROM, RUN, COPY, CMD, ENTRYPOINT, WORKDIR. Layer cache, .dockerignore, USER non-root, multi-stage build.
bind mount vs named volume vs tmpfs. Anonymous volumes and why you need to clean them up. The classic DB_HOST=localhost trap.
Default bridge vs user-defined, DNS by service name, host and none, port publishing. Why two different networks can't see each other.
Describe a stack in yaml, bring it up with one command. depends_on, healthcheck, profiles, the main commands, and where Kubernetes takes over.
Eight questions on images, networking, volumes, Dockerfile, and compose. You can retake it.
Going deeper
Where Docker images live: registries, push/pull, tags and digests, private registries, and logging in.
Why ENV and build args leak, how to hand secrets to a container properly, and BuildKit secrets at build time.
Exit codes and what they mean, logs and inspect for a crashed container, a restart loop, a "no such file" error when the file is right there, and debugging a container with no shell.