What does --chown do in this instruction?
COPY --chown=app:app . /app
- Switches USER for later steps
- Makes the copied files read-only
- Creates the app user in the image
- Gives the copied files to app:app
Files added by COPY are owned by root by default; --chown sets their owner and group in the same layer, avoiding a separate RUN chown that duplicates them.
Play DevOps ▸