build(docker): dockerfile improvements - #1173
Open
DevipriyaS17 wants to merge 4 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1173 +/- ##
=======================================
Coverage 50.09% 50.09%
=======================================
Files 146 146
Lines 13552 13552
=======================================
Hits 6789 6789
Misses 6171 6171
Partials 592 592 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sudhir-intc
reviewed
Aug 3, 2026
Contributor
|
@DevipriyaS17 This change is related to Docker build configuration, so build(docker): would be a better Conventional Commit type than fix: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the project’s Docker build to better support cross-platform builds and faster rebuilds, while fixing missing CA certificates in the final scratch image to enable proper TLS verification.
Changes:
- Installs
ca-certificatesin the builder stage so the final stage’s certificate copy actually includes the bundle. - Switches from a hardcoded
GOARCH=amd64toTARGETARCHfor multi-archdocker buildxbuilds. - Adds BuildKit cache mounts for Go build and module cache paths to speed up iterative builds.
Suppressed comments (1)
Dockerfile:39
GOARCH=$TARGETARCHalone is not sufficient for arm variants; ensureGOARMis set fromTARGETVARIANTwhenTARGETARCH=armsobuildx --platform=linux/arm/v7produces the correct binary.
if [ -n "$BUILD_TAGS" ]; then \
CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -tags="$BUILD_TAGS_GO" -o /bin/app ./cmd/app; \
else \
CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /bin/app ./cmd/app; \
fi'
DevipriyaS17
force-pushed
the
docker_changes
branch
from
August 4, 2026 08:28
bf4a8a3 to
54eda2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dockerfile improvements
Changes
DockerfileRUN apk add --no-cache ca-certificatesinbuilder stage. Previously
COPY ca-certificates.crtin the final stage silentlycopied nothing since the package was never installed.
GOARCH=amd64withARG TARGETARCH=amd64to support cross-platform builds via
docker buildx --platform.--mount=type=cachefor/root/.cache/go-buildand/go/pkg/mod/cachefor faster iterative builds.go mod tidy— themodulesstagealready downloads deps; re-running tidy after
COPY . /appinvalidated the cacheon every source change.