Docker CLI sends a REST API request to the Docker daemon (dockerd).
The daemon checks if the image exists locally. If not, it pulls it from the registry layer by layer.
The daemon calls containerd to create a container from the image.
containerd uses runc (OCI runtime) to set up Linux namespaces (PID, NET, MNT, UTS, IPC, USER) and cgroups for resource isolation.
The overlay filesystem is assembled: read-only image layers + a thin writable container layer on top.
Network namespace is configured (veth pair bridged to docker0 by default).
The container's entrypoint/cmd process starts as PID 1 inside the namespace.
How does Docker layer caching work?
Show the answer
Each Dockerfile instruction creates a read-only layer. Docker uses a content-addressable cache keyed on:
The parent layer's ID.
The instruction string.
For COPY/ADD: the checksum of the copied files.
If a layer's cache key matches, Docker reuses the cached layer and skips rebuilding. Cache is invalidated for a layer and all layers below it when:
The instruction or its inputs change.
A COPY/ADD source file changes.
--no-cache flag is passed.
Best practice: Order instructions from least-to-most frequently changing. Copy dependency manifests (package.json, requirements.txt) and install dependencies before copying application source code so dependency layers are cached even when source changes.
What happens when systemd hits a failing unit in a containerized node? How would you auto-recover?
Show the answer
When a systemd unit fails, systemd marks it as failed and stops restart attempts after StartLimitBurst retries. In a containerized environment (e.g., EKS node):
Container runtime units (containerd, kubelet) failing can cause node NotReady.
Auto-recovery: configure Restart=always and RestartSec=5s in the unit file; set StartLimitIntervalSec=0 to remove the restart rate limit for critical units.
At the cluster level, node problem detector (NPD) reports systemic failures as node conditions, and cluster-autoscaler or a node health controller can cordon and drain the node, then replace it.
39 more in the member app, with practice sets and your own marks. Join free