Skip to content

Commit 6bd2198

Browse files
committed
docs(ci-testing): hadolint floating-latest policy — fix surfaced findings, never pin
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent dff7e00 commit 6bd2198

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

skills/docker-development/references/ci-testing.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,30 @@ When smoke/boot-testing an image by hand (not in the CI matrix):
178178
- **Foreground apps that log to a file leave `docker logs` empty.** E.g. Tomcat started with `-fg` writes to `logs/catalina.out`, not stdout — an empty `docker logs` does *not* mean "nothing happened". Read the in-container log files (`docker exec <c> sh -c 'tail -n 80 .../catalina.out'`), and check the process and state (`docker inspect -f '{{.State.Status}} {{.State.ExitCode}}' <c>`).
179179
- **Minimal/distroless images have no shell.** `docker exec … sh`/`tail`/`pgrep` won't exist on `scratch`/distroless runtimes — probe with host-side `curl` against a published port, `docker inspect` for state, or a debug sidecar (`docker run --rm --pid container:<c> busybox …`).
180180
- **Grep for real failure signals, not benign noise.** After a bundled-dependency swap, scan logs for `NoSuchMethodError|AbstractMethodError|LinkageError|IncompatibleClassChangeError` (binary incompatibility) — not bare `ClassNotFoundException`, which OSGi/plugin frameworks emit normally.
181+
182+
## hadolint in CI: floating `latest` is a feature — fix findings, don't pin
183+
184+
CI lint jobs typically run `hadolint/hadolint:latest-alpine`. A hadolint
185+
release can turn a previously-quiet rule into a failure overnight, so an
186+
unrelated MR (a Renovate version bump, a docs change) suddenly goes red.
187+
188+
Diagnose before blaming the diff: if the default branch's last green run
189+
predates the failure and re-running it fails identically, the linter moved,
190+
not your change.
191+
192+
Policy: treat the new finding as surfaced debt and fix it in the same MR —
193+
do not pin the hadolint image and do not add an ignore. Pinning hides every
194+
future rule improvement; the debt only grows.
195+
196+
Concrete case (2026-08-13, `docker/node-red`): a hadolint update started
197+
failing `DL3066` (non-numeric user-id) on `USER root` / `USER node-red`.
198+
Fix: use the numeric ids the image already establishes —
199+
200+
```dockerfile
201+
USER 0
202+
RUN apk add --no-cache shadow && usermod -u 10458 node-red && apk del shadow
203+
USER 10458
204+
```
205+
206+
No behavior change, and the id survives environments that cannot resolve
207+
container-internal user names.

0 commit comments

Comments
 (0)