Ensure minimal execution of 'chown'

Immutable containers do not update their code automatically at runtime and, in this way, you can prevent your running application from being accidentally or maliciously modified.

Risk Level: informational
Platform: Docker
Spectral Rule ID: DOCKR011


Most of the time, you can just drop the chown option. The app user only needs execution permissions on the file, not ownership.

- COPY --chown=app:app app-src/ /app
+ COPY app-src/ /app
USER app
ENTRYPOINT /app/main.sh

Read more:

  • TBD