Skip to content

Improve docker build performance#5549

Merged
Warashi merged 6 commits intomasterfrom
faster-docker-build
Feb 17, 2025
Merged

Improve docker build performance#5549
Warashi merged 6 commits intomasterfrom
faster-docker-build

Conversation

@Warashi
Copy link
Member

@Warashi Warashi commented Feb 7, 2025

What this PR does:

Build a Go binary with the host platform using the GOOS/GOARCH option and copy it to the target container image.
ref; https://docs.docker.com/build/building/multi-platform/#cross-compiling-a-go-application

Why we need it:

We sometimes face build failure at go build. I think this comes from QEMU and Go combination. So I changed the Dockerfile to build go binary without QEMU.
https://github.com/pipe-cd/pipecd/actions/runs/13126728528/job/36624384578#step:8:1

Which issue(s) this PR fixes:

Maybe fixes #5548

Does this PR introduce a user-facing change?: No

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
@Warashi Warashi marked this pull request as ready for review February 7, 2025 01:38
@codecov
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.41%. Comparing base (de1800e) to head (1b95b05).
Report is 281 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5549      +/-   ##
==========================================
- Coverage   26.42%   26.41%   -0.01%     
==========================================
  Files         465      465              
  Lines       49907    49907              
==========================================
- Hits        13189    13185       -4     
- Misses      35663    35666       +3     
- Partials     1055     1056       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ffjlabo
Copy link
Member

ffjlabo commented Feb 10, 2025

@Warashi
Copy link
Member Author

Warashi commented Feb 13, 2025

@Warashi So we don't need the QEMU setup in the workflow? https://github.com/pipe-cd/pipecd/blob/75db0fad0eb9d6a08914a73a003f455442a42c38/.github/workflows/publish_image_chart.yaml#L66C1-L70C91

@ffjlabo Thank you for your comment.
We still need QEMU because some multi-stage builds that have no platform options are run on QEMU.
We have to run them on QEMU because the final image must be built on the same platform as the image's platform.

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to approve 🙏 LGTM

@Warashi Warashi merged commit 38d0af1 into master Feb 17, 2025
13 of 14 checks passed
@Warashi Warashi deleted the faster-docker-build branch February 17, 2025 02:29
@github-actions github-actions bot mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker image build on CI failure

3 participants