Section 4 (Container Images and Build File)
| Section | Recommendation | Description |
|---|---|---|
| 4.1 | Create user for the container | Specify a non-root USER |
| 4.2 | Use trusted base images | Use an explicit base image version and avoid the latest tag |
| 4.3 | Do not install unnecessary packages | Minimize unnecessary and recommended packages |
| 4.6 | Add HEALTHCHECK | Define a HEALTHCHECK instruction |
| 4.7 | Do not use update instructions alone | Combine apt-get update and install in one RUN |
| 4.9 | Use COPY instead of ADD | Use COPY rather than ADD |
| 4.10 | Do not store secrets in Dockerfile | Do not hardcode secrets |