Skip to content

Files

Latest commit

 

History

History
26 lines (16 loc) · 814 Bytes

DL3057.md

File metadata and controls

26 lines (16 loc) · 814 Bytes

Pattern: Missing HEALTHCHECK instruction

Issue: -

Description

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

Further Reading