All jobs / DevOps / SRE / cloud / Containers

DevOps / SRE / cloud interview question · 1–3 years

The Dockerfile has no USER line, so the app runs as root. Does that matter inside a container?

The strongest answer

Yes — containers share the host kernel, so a breakout or a mounted host path is root on the host; set a non-root USER, read-only root filesystem, drop capabilities and never run privileged

Why it works

Right — container isolation is namespaces and cgroups, not a hypervisor. Least privilege applies inside the box too.

What a good answer covers

Answers that fall short

Who gets asked this

More Containers questions