Docker - Use COPY --chown instead of RUN chown after COPY in Dockerfile


Docker best practice:

Use --chown option of Docker's COPY command instead of doing it manually to reduce build time.

 # manually changing owner
 COPY . $APP_HOME
 RUN chown -r app:app $APP_HOME

 # using --chown option
 COPY --chown=app:app . $APP_HOME