A Dockerfile for a zoning-map renderer installs packages with RUN. When do those RUN commands execute?
Select an answer to reveal the explanation.
Short Explanation
RUN is workshop time: you install tools while building the machine. Once the machine ships, those install steps do not re-run just because someone turns the power on.
Full Explanation
RUN executes during docker build while layers are being added to the zoning-map renderer image. Package installs, compile steps, and other workshop work belong in that phase and typically produce filesystem layers baked into the finished artifact. Those commands do not re-run when a container later starts; start behavior is defined separately by ENTRYPOINT and CMD. Combining related package operations into one RUN can keep layer count intentional without changing the fact that execution happens at build time, not at every boot.
RUN does not wait for the first HTTP request in production before installing packages. It does not re-execute on every docker run of a new container from the finished image. When OKE schedules a Pod, the cluster starts the already-built image—it does not replay Dockerfile RUN instructions or replace ENTRYPOINT with those install commands.
Exam caveat: a failed RUN fails the build early and loudly; a missing runtime dependency that should have been installed at build time usually shows up later as a start or import error, which is a signal the install belonged in RUN. Operational check: inspect image history after build to confirm RUN layers are present, then start a container and verify package-install commands are not reappearing in container logs on every boot.