Challenge,
While there might be no immediate practical use for this in a regular Docker workflow, sharing namespaces between containers is a widely used technique employed by:
- Kubernetes Pods, including ephemeral containers
- Container debugging tools (
cdebug
,docker debug
,kubectl debug
, etc.) - Infrastructure projects (e.g., iximiuz Labs playground engine)
In this challenge, you'll need to start a new container in the namespaces of another, already running container, effectively making it a sidecar:
- The
target
container is a simple HTTP API server that already runs in the background - You need to start a new container, called
sidecar
, that runs an interactive shell inside - You can use any image for the
sidecar
container (busybox
oralpine
are good choices) - The
sidecar
container should share the PID, IPC, and network namespaces of thetarget
container (instead of creating its own)
Good luck!
Level up your Server Side game — Join 13,000 engineers who receive insightful learning materials straight to their inbox