Skip to content

frontend/dockerfile: fix HEALTHCHECK history formatting#6664

Merged
tonistiigi merged 1 commit intomoby:masterfrom
thaJeztah:fix_healthcheck
Apr 7, 2026
Merged

frontend/dockerfile: fix HEALTHCHECK history formatting#6664
tonistiigi merged 1 commit intomoby:masterfrom
thaJeztah:fix_healthcheck

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Apr 7, 2026

govet started to complain:

 > [golangci-lint 1/1] RUN --mount=target=/go/src/github.com/moby/buildkit     --mount=target=/root/.cache,type=cache,id=lint-cache-default-freebsd/amd64   xx-go --wrap &&   golangci-lint run --build-tags "" &&   touch /golangci-lint.done:
111.1 frontend/dockerfile/dockerfile2llb/convert.go:1601:60: printf: fmt.Sprintf format %q has arg d.image.Config.Healthcheck of wrong type *github.com/moby/docker-image-spec/specs-go/v1.HealthcheckConfig (govet)
111.1 	return commitToHistory(&d.image, fmt.Sprintf("HEALTHCHECK %q", d.image.Config.Healthcheck), false, nil, d.epoch)
111.1 	                                                          ^
111.1 1 issues:
111.1 * govet: 1

Before this, the HEALTHCHECK would be formatted like;

HEALTHCHECK {["bin" "-c" "exit 0"] "1s" "10s" "3s" "100ms" '\x05'}

After this, it includes both the fields and values:

HEALTHCHECK {Test:[bin -c exit 0] Interval:1s Timeout:10s StartPeriod:3s StartInterval:100ms Retries:5}

govet started to complain:

```
 > [golangci-lint 1/1] RUN --mount=target=/go/src/github.com/moby/buildkit     --mount=target=/root/.cache,type=cache,id=lint-cache-default-freebsd/amd64   xx-go --wrap &&   golangci-lint run --build-tags "" &&   touch /golangci-lint.done:
111.1 frontend/dockerfile/dockerfile2llb/convert.go:1601:60: printf: fmt.Sprintf format %q has arg d.image.Config.Healthcheck of wrong type *github.com/moby/docker-image-spec/specs-go/v1.HealthcheckConfig (govet)
111.1 	return commitToHistory(&d.image, fmt.Sprintf("HEALTHCHECK %q", d.image.Config.Healthcheck), false, nil, d.epoch)
111.1 	                                                          ^
111.1 1 issues:
111.1 * govet: 1
```

Before this, the HEALTHCHECK would be formatted like;

    HEALTHCHECK {["bin" "-c" "exit 0"] "1s" "10s" "3s" "100ms" '\x05'}

After this, it includes both the fields and values:

    HEALTHCHECK {Test:[bin -c exit 0] Interval:1s Timeout:10s StartPeriod:3s StartInterval:100ms Retries:5}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Copy Markdown
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PTAL @tonistiigi

@crazy-max crazy-max added this to the v0.30.0 milestone Apr 7, 2026
@tonistiigi tonistiigi merged commit dab3bfa into moby:master Apr 7, 2026
216 of 217 checks passed
@thaJeztah thaJeztah deleted the fix_healthcheck branch April 7, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants