Containerize a legacy app that writes config on startup and expects root.
AdvancedScenarioCI/CD and production rollouts
Answer
Situation read → Not cloud-native.
What I'd do → Wrap with an entrypoint that templates config from env into a writable dir, run as non-root with chown on needed dirs at build time, mount state on a volume, send logs to stdout, and add a health script. If root is unavoidable, drop capabilities, use userns/rootless and read-only mounts.
Why → Incremental hardening beats rewriting.
Interview tip → Document the exceptions and set a remediation plan.
More on CI/CD and production rollouts
Design a GitHub Actions workflow that builds, scans and pushes an image.IntermediateZero-downtime deploy on a single Docker host.AdvancedDeploy via GitOps with image digests.IntermediateCanary a new image on a Swarm service.AdvancedDocker build is flaky in CI due to network errors on package installs.IntermediateRun database migrations in the deploy flow of containerized apps.Intermediate