Interview Prep/Docker/Dockerfile Instructions & Builds

How do `--chown` and `--chmod` on `COPY` help?

AdvancedConceptDockerfile Instructions & Builds
Answer

They set ownership and mode at copy time in the same layer, avoiding a separate RUN chown -R which duplicates the data into a new layer (doubling size).

COPY --chown=10001:10001 --chmod=0555 ./dist /app
All Docker questions Roadmap: Docker & containers

More on Dockerfile Instructions & Builds