10BC0 Optimize Go Docker builds with native cross-compilation by J12934 · Pull Request #3206 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@J12934
Copy link
Member
@J12934 J12934 commented Aug 13, 2025

Description

Replace multi-arch emulation with native Go cross-compilation for faster builds:

  • Add --platform=$BUILDPLATFORM to builder stage
  • Use TARGETOS/TARGETARCH build args for Go cross-compilation
  • Apply GOOS/GOARCH environment variables in build command

Affected components:

  • operator: Updated manager build process
  • lurker: Updated lurker build process
  • auto-discovery/kubernetes: Updated manager build process
  • auto-discovery/cloud-aws: Updated service build process

This eliminates slow emulation overhead while maintaining multi-arch support.

Done becuase the prod builds are really slow, like 15-20min, this should safe a bit of CPU time and overhead :)

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure that all your commits are signed-off and that you are added to the Contributors file.
  • Make sure that all CI finish successfully.
  • Optional (but appreciated): Make sure that all commits are Verified.

Replace multi-arch emulation with native Go cross-compilation for faster builds:
- Add --platform=$BUILDPLATFORM to builder stage
- Use TARGETOS/TARGETARCH build args for Go cross-compilation
- Apply GOOS/GOARCH environment variables in build command

Affected components:
- operator: Updated manager build process
- lurker: Updated lurker build process
- auto-discovery/kubernetes: Updated manager build process
- auto-discovery/cloud-aws: Updated service build process

This eliminates slow emulation overhead while maintaining multi-arch support.

Signed-off-by: Jannik Hollenbach <jannik.hollenbach@iteratec.com>
@J12934 J12934 self-assigned this Aug 13, 2025
@netlify
Copy link
netlify bot commented Aug 13, 2025

Deploy Preview for docs-securecodebox canceled.

Name Link
🔨 Latest commit 8a479be
🔍 Latest deploy log https://app.netlify.com/projects/docs-securecodebox/deploys/689c5d91f48de300080d2b54
8000

Not sure why sonar needed to loose its shit over this...

Signed-off-by: Jannik Hollenbach <jannik.hollenbach@iteratec.com>
@sonarqubecloud
Copy link

Copy link
Contributor
@Reet00 Reet00 left a comment

Choose a reason for hiding this comment

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

lgtm

@github-project-automation github-project-automation bot moved this from Triage to Reviewer Approved in secureCodeBox Aug 15, 2025
@Reet00 Reet00 merged commit bfabf0d into secureCodeBox:main Aug 15, 2025
48 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in secureCodeBox Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

0