Interview Q&A / Docker & Kubernetes
Docker & Kubernetes interview questions
Images, containers, Dockerfiles, pods and deployments, from first principles.
Prefer rapid revision? Practise Docker & Kubernetes short interview answers →
- Why use WORKDIR instead of RUN cd in a Dockerfile?
WORKDIR sets the working directory for all later instructions and the running container, and creates it if missing. RUN cd only affects that single RUN line, because each RUN starts a fresh shell.
BeginnerQuick answer1 min read