$ ./guess_the_languageDevOps
DevOps · easy · #269

What does --chown do in this instruction?

COPY --chown=app:app . /app
  1. Switches USER for later steps
  2. Makes the copied files read-only
  3. Creates the app user in the image
  4. 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 ▸