Skip to content

build: clear the Dockerfile build-check warnings - #6768

Merged
otavio merged 2 commits into
masterfrom
build/dockerfile-lint-warnings
Jul 30, 2026
Merged

build: clear the Dockerfile build-check warnings#6768
otavio merged 2 commits into
masterfrom
build/dockerfile-lint-warnings

Conversation

@otavio

@otavio otavio commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

CI surfaced a RedundantTargetPlatform warning on the agent image build. Running docker build --check across every Dockerfile in the repo turned up two more instances of a second warning, so this clears all of them.

Two commits, one per warning type:

  • build(agent): drop the redundant target platform on the runtime stageFROM already resolves to $TARGETPLATFORM, so FROM --platform=$TARGETPLATFORM is a no-op. Dropped it along with the two comments that only restated it.
  • build: use the key=value form for ENV instructions — replaces the deprecated ENV key value form in agent/, openapi/, and ui/.

Testing

docker build --check reports "no warnings found" for all three changed files; cli/, server/, and gateway/ were already clean.

No behavior change:

  • build-agent.yml passes --platform explicitly to every buildx build (the amd64 scan build, the 5-arch push, and the per-arch rootfs export), and runtime-utils still resolves to the target architecture in each.
  • The trivy-image matrix in security.yml builds without a platforms: input, so it targets the runner platform as before.
  • ENV k=v is semantically identical to ENV k v, so the GOPROXY / NPM_CONFIG_REGISTRY build args passed by compose and CI are unaffected.

Notes

agent/Dockerfile.test still trips SecretsUsedInArgOrEnv on its ARG PASSWORD. That is a deliberate throwaway credential for the test image, which no workflow builds, so it is left as-is.

otavio added 2 commits July 30, 2026 12:05
A FROM instruction already resolves to $TARGETPLATFORM, so pinning it
explicitly is a no-op that trips the RedundantTargetPlatform check in
the image build. The multi-arch build still resolves runtime-utils to
the target architecture.
The legacy "ENV key value" form is deprecated and reported by the
LegacyKeyValueFormat build check.
@otavio
otavio requested review from a team as code owners July 30, 2026 15:05
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Claude finished @otavio's task in 46s —— View job


Code Review Complete

Reviewed 3 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is.

Verified the key correctness claim: dropping --platform=$TARGETPLATFORM on the runtime-utils stage is a genuine no-op, since a FROM stage without an explicit --platform already defaults to the build's target platform. The arch-specific binaries copied into the final scratch image (nsenter, setpriv, libcap-ng.so, ld-musl) still resolve to the target architecture. The ENV key=value conversions are semantically identical to the deprecated form.


To request another review round, comment /review.

@otavio
otavio enabled auto-merge (rebase) July 30, 2026 15:08
@otavio
otavio merged commit 132b860 into master Jul 30, 2026
50 of 52 checks passed
@otavio
otavio deleted the build/dockerfile-lint-warnings branch July 30, 2026 15:15
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