Skip to content
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

[1.23] fix(go/base): set GOTOOLCHAIN=local and skip building arm using the base Dockerfile #527

Merged
merged 4 commits into from
Mar 4, 2025

Conversation

v1v
Copy link
Member

@v1v v1v commented Feb 28, 2025

See #524 and #523

Waiting for https://buildkite.com/elastic/auditbeat/builds?branch=v1v%3Atest%2F42705

and wait for those PRs that are good to be merged, then we can merge this as long as elastic/beats#42960 passes

andrewkroh and others added 4 commits February 28, 2025 11:29
Disable the automatic downloads of the Go toolchain.

For the goal of reproducible builds using golang-crossbuild, we want all
of the binaries used to produce our artifacts to be self-contained in
the image. Adding GOTOOLCHAIN=local disable downloads of newer
toolchains.

This changes the entrypoint of the images to document that GOTOOLCHAIN
is set during builds.  And it sets GOTOOLCHAIN=local in the Dockerfile
so that when building entrypoint.go it uses the toolchain that was
previously installed.

The two Dockerfiles (base and base-arm) had different 'go build'
commands. This unifies them to both have CGO_ENABLED=0 and to explicitly
set GOARCH to avoid accidentally producing a binary for the wrong target
architecture (which we've seen happen for unknown reasons).

https://go.dev/doc/toolchain
@elasticmachine
Copy link

💚 Build Succeeded

v1v added a commit to v1v/beats that referenced this pull request Feb 28, 2025
@elasticmachine
Copy link

💚 Build Succeeded

@elasticmachine
Copy link

elasticmachine commented Feb 28, 2025

@v1v v1v self-assigned this Feb 28, 2025
@v1v v1v marked this pull request as ready for review February 28, 2025 11:30
@v1v v1v requested a review from a team as a code owner February 28, 2025 11:30
@v1v v1v changed the title Fix on top of 523 [1.23] fix(go/base): set GOTOOLCHAIN=local and skip building arm using the base Dockerfile Feb 28, 2025
@v1v v1v marked this pull request as draft February 28, 2025 11:49
v1v added a commit to elastic/fleet-server that referenced this pull request Mar 3, 2025
@v1v v1v marked this pull request as ready for review March 3, 2025 15:52
@v1v v1v requested a review from a team March 3, 2025 15:52
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.

5 participants