Skip to content

Fix CI: ignore hadolint DL3066 for the named user in the Dockerfile - #2313

Merged
felladrin merged 1 commit into
mainfrom
fix/hadolint-dl3066
Aug 5, 2026
Merged

Fix CI: ignore hadolint DL3066 for the named user in the Dockerfile#2313
felladrin merged 1 commit into
mainfrom
fix/hadolint-dl3066

Conversation

@felladrin

Copy link
Copy Markdown
Owner

Description

Currently, CI is red on main, and it blocks every open PR from going green. The Lint Dockerfile step fails with Dockerfile:43 DL3066 info: Non-numeric user-id may not be resolvable by host system, pointing at USER ${USERNAME}.

This PR adds DL3066 to the ignore list in .hadolint.yaml. The image runs as the named node user that the node base image already provides, so the non-numeric user-id resolves inside the container. That's by design, not something to fix in the Dockerfile.

Root cause

#2311 bumped hadolint/hadolint-action to v3.4.0, which pins hadolint:v2.15.0-debian. That version reports DL3066 where the previous one did not. The action's default failure-threshold is info, so an info-level finding is enough to fail the job. #2310, the commit right before it, has a green run, which confirms the bump is what changed.

The step also short-circuits the rest of the job: Check formatting and Run tests are skipped when the Dockerfile lint fails, so no PR gets its tests run in CI until this lands.

Why the ignore, and not a higher threshold

Raising failure-threshold above info would also fix the red build, but it would stop info-level findings from blocking anything else, for a single rule we disagree with. The ignore entry is narrower.

By the way, this rule looks like it was short-lived upstream: hadolint 2.15.1 no longer reports DL3066 on this Dockerfile, only 2.15.0 does. So a future action bump may make the entry unnecessary. It's harmless to keep either way, and I'd rather not wait on a release we don't control.

How to test

  1. Check out the branch and run hadolint with the exact image the action pins:
docker run --rm -i -v "$PWD/.hadolint.yaml":/.hadolint.yaml ghcr.io/hadolint/hadolint:v2.15.0-debian hadolint --config /.hadolint.yaml --failure-threshold info - < Dockerfile

It exits 0. On main the same command reports DL3066 and exits 1.

  1. Confirm the ignore list is still narrow (other rules keep firing at the same threshold):
printf 'FROM node:lts\nRUN cd /tmp\n' | docker run --rm -i -v "$PWD/.hadolint.yaml":/.hadolint.yaml ghcr.io/hadolint/hadolint:v2.15.0-debian hadolint --config /.hadolint.yaml --failure-threshold info -

It reports DL3003 and SC2164, and exits 1.

  1. Run the two steps that were being skipped: npm run format:check passes (172 files, no fixes applied), and npm run test:coverage passes (40 test files, 349 tests).

Note: npm run lint exits 1 on my machine, on main too, from a knip "Unlisted binaries: playwright" report. It's a local environment difference, not from this change; the Run lint step passed in CI on the failing run.

hadolint 2.15.0, pinned by hadolint-action v3.4.0, reports DL3066 on `USER ${USERNAME}`. The action's default failure-threshold is info, so the finding fails the job and skips the formatting and test steps after it.
@felladrin
felladrin marked this pull request as ready for review August 5, 2026 13:06
@felladrin
felladrin merged commit ef45fe3 into main Aug 5, 2026
7 checks passed
@felladrin
felladrin deleted the fix/hadolint-dl3066 branch August 5, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant