Pattern: Missing HEALTHCHECK
instruction
Issue: -
When it is required to define a health check (e.g. by company policy), it must not be omitted.
This rule is disabled by default, because a HEALTHCHECK
is not desirable in all circumstances. Images used with Kubernetes for example do not benefit from a HEALTHCHECK
instruction, as Kubernetes brings its own mechanisms to accomplish the same thing. If however it is desired, this rule makes sure a build stage either has a HEALTHCHECK
instruction, or inherits it from an earlier build stage.
Example of incorrect code:
FROM busybox
Example of correct code:
FROM busybox
HEALTHCHECK CMD /bin/health