-
Notifications
You must be signed in to change notification settings - Fork 197
fix(infra): ensure base images use target platform #2401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughMultiple Dockerfiles switch platform selection from BUILDPLATFORM to TARGETPLATFORM in FROM instructions. otelcollector also changes its builder base image to golang:1.25, prefixes its ocb invocation with GOOS/GOARCH, and removes ENTRYPOINT/CMD. No exported/public API changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (4)
🧰 Additional context used🪛 GitHub Check: build_push_imagecdn-server/Dockerfile[warning] 24-24: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
🔇 Additional comments (5)
Comment |
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2401 +/- ##
==========================================
+ Coverage 1.49% 36.73% +35.23%
==========================================
Files 292 833 +541
Lines 46926 113476 +66550
Branches 431 4625 +4194
==========================================
+ Hits 703 41687 +40984
- Misses 45940 70193 +24253
- Partials 283 1596 +1313 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
otelcollector/Dockerfile(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_test
🔇 Additional comments (1)
otelcollector/Dockerfile (1)
27-28: Address summary inconsistency regarding ENTRYPOINT and CMD.The AI-generated summary claims that
ENTRYPOINT ["/otelcol"]andCMD ["--config", "/etc/otel-config.yaml"]were removed, but they remain in the code at lines 27–28. Clarify whether these lines were intentionally kept (summary is outdated) or if the code change is incomplete.
5959f2e to
733fb7b
Compare
7dd87bc to
8eacb6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cdn-server/Dockerfile (1)
1-1: Correct multi-arch build strategy, but reconsider explicit TARGETPLATFORM.The change correctly uses BUILDPLATFORM for the builder stage (native compilation) and TARGETPLATFORM for the final stage (runtime platform). However, static analysis flags that explicitly setting TARGETPLATFORM is redundant—it's Docker's default behavior when no platform is specified.
Consider two approaches:
- Keep the explicit platform for clarity (documents intent).
- Remove
--platform=${TARGETPLATFORM}to rely on the default, reducing redundancy.The PR description indicates a systematic fix across multiple Dockerfiles. Verify the chosen approach is consistent across all modified files.
Also applies to: 24-24
controlplane/Dockerfile (1)
1-1: Same pattern: correct multi-arch strategy, redundant explicit platform flag.Line 35 mirrors the same change in cdn-server/Dockerfile. The final stage correctly switches from BUILDPLATFORM to TARGETPLATFORM, but static analysis identifies the explicit
--platform=${TARGETPLATFORM}as redundant since TARGETPLATFORM is the Docker default when building for a specific target platform.If the pattern is intentional for documentation/clarity across the codebase, approve as-is. If it's an oversight, consider removing the explicit flag to streamline the Dockerfiles.
Also applies to: 35-35
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
admission-server/Dockerfile(1 hunks)cdn-server/Dockerfile(1 hunks)controlplane/Dockerfile(1 hunks)graphqlmetrics/Dockerfile(1 hunks)keycloak/Dockerfile(2 hunks)otelcollector/Dockerfile(1 hunks)router/Dockerfile(2 hunks)studio/Dockerfile(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- admission-server/Dockerfile
- studio/Dockerfile
- otelcollector/Dockerfile
- graphqlmetrics/Dockerfile
- router/Dockerfile
- keycloak/Dockerfile
🧰 Additional context used
🪛 GitHub Check: build_push_image
cdn-server/Dockerfile
[warning] 24-24: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior
RedundantTargetPlatform: Setting platform to predefined ${TARGETPLATFORM} in FROM is redundant as this is the default behavior
More info: https://docs.docker.com/go/dockerfile/rule/redundant-target-platform/
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: build-router
- GitHub Check: build_push_image
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: build_test
- GitHub Check: integration_test (./events)
- GitHub Check: image_scan (nonroot)
- GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
- GitHub Check: image_scan
- GitHub Check: build_push_image (nonroot)
- GitHub Check: build_test
- GitHub Check: integration_test (./telemetry)
- GitHub Check: build_push_image
- GitHub Check: build_push_image
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
fix(infra): maintain build host builder, use target in final stage
8eacb6d to
4dd3805
Compare
Thank you @joornby-angel for your contribution!
Hijacked from #2242
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist