CIS Docker Benchmark

XEIZE checks Dockerfile and Docker Compose settings related to selected image and build recommendations in Section 4 of the CIS Docker Benchmark.

Section 4 (Container Images and Build File)

Section Recommendation Description
4.1 Create user for the container Set USER to the non-root account that runs the container.
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 Check that the inherited HEALTHCHECK tests your service, or define one that does.
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 to copy local files from the build context into the image.
4.10 Do not store secrets in Dockerfile Do not hardcode secrets

References