1 DL3057
Moritz Röhrich edited this page 2021-03-21 11:37:07 +01:00

HEALTHCHECK instruction missing.

This is an optional rule which is disabled by default. To enable it, set its severity to the preferred level, e.g.

$ hadolint --warning=DL3057 Dockerfile

Problematic code:

FROM busybox

Correct code:

FROM busybox
HEALTHCHECK CMD /bin/health

or

FROM busybox
HEALTHCHECK NONE

Rationale:

When it is required to define a health check (e.g. by company policy), it must not be omitted.

Note:

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.