Docker & Containers
Container PID 1
Explain why PID 1 in a container must reap orphans and receive signals, and how --init and the exec form fix a stop that always takes ten seconds.
What you will be able to do
- Explain the two jobs PID 1 has in a container.
- Diagnose a container that stops slowly or leaves defunct processes.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Docker & Containers
- Multi stage buildsIntermediate · 4 min
Explain how multi-stage Dockerfiles keep build tools out of the final image, how COPY --from chooses what the runtime stage receives, and when a broad copy undoes it.
- Distroless imagesIntermediate · 4 min
Explain what distroless base images contain, what they leave out, and how to debug and scan them safely when the running container has no shell.
- Signal forwardingIntermediate · 4 min
Explain how the stop signal reaches a container's app, and why exec form and a program that handles SIGTERM are needed for a clean shutdown.
- Container capabilitiesIntermediate · 4 min
Explain how Linux capabilities split root privilege, and how to drop all capabilities and add back only the one a container needs, checked against its process status…
- User namespace remapIntermediate · 4 min
Explain how user namespace remapping maps container root to an unprivileged host user, and what that means for existing volumes and images before you enable it.
- seccomp profilesIntermediate · 5 min
Explain how a seccomp profile filters system calls, and how to test whether a seccomp block, rather than a missing capability, causes an EPERM error.