How would you handle a Docker image that must run as root (a legacy vendor image)?
AdvancedProductionArchitecture & Design Decisions
Answer
Contain the blast radius: user-namespace remap or rootless runtime so "root" is unprivileged on the host, drop all capabilities except needed ones, read-only root with tmpfs, no-new-privileges, seccomp default, isolated network with egress limits, no host mounts, and resource limits. Ask the vendor for a non-root build and document the exception with a review date.
More on Architecture & Design Decisions
How would you design a container build-and-deploy pipeline from commit to production?AdvancedWhen should you use Docker Compose, Swarm, ECS, or Kubernetes?IntermediateHow do you decide how many processes belong in one container?BeginnerHow do you design the config strategy for containerized apps (12-factor)?IntermediateHow would you containerize a legacy app that writes to local disk and holds sessions in memory?AdvancedAlpine or Debian-slim for a Python service?Intermediate