fix: package fleet-server using golang-crossbuild #5392
Merged
pkoutsovasilis merged 4 commits intoelastic:mainfrom Sep 5, 2025
Merged
fix: package fleet-server using golang-crossbuild #5392pkoutsovasilis merged 4 commits intoelastic:mainfrom
pkoutsovasilis merged 4 commits intoelastic:mainfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
4d7b666 to
08e28d8
Compare
08e28d8 to
b03b667
Compare
|
ebeahan
approved these changes
Sep 4, 2025
ycombinator
approved these changes
Sep 4, 2025
Contributor
|
@Mergifyio backport 8.18 8.19 9.0 9.1 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69)
mergify bot
pushed a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) # Conflicts: # .buildkite/pipeline.package.mbp.yml # .buildkite/pipeline.yml # .buildkite/scripts/package.sh # Dockerfile.fips # magefile.go
8 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) # Conflicts: # .buildkite/pipeline.package.mbp.yml # .buildkite/pipeline.yml # .buildkite/scripts/package.sh # Dockerfile.fips # magefile.go
This was referenced Sep 5, 2025
mergify bot
pushed a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69)
8 tasks
pkoutsovasilis
added a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis
added a commit
that referenced
this pull request
Sep 5, 2025
* fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
8 tasks
This was referenced Sep 5, 2025
pkoutsovasilis
added a commit
that referenced
this pull request
Sep 8, 2025
…ld (#5429) * fix: package fleet-server using golang-crossbuild (#5392) * fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) # Conflicts: # .buildkite/pipeline.package.mbp.yml # .buildkite/pipeline.yml # .buildkite/scripts/package.sh # Dockerfile.fips # magefile.go * fix: adjust changes for make * fix: fleet-server-package-mbp CI step dependencies (#5446) (cherry picked from commit 5aa10ef) --------- Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis
added a commit
that referenced
this pull request
Sep 8, 2025
…ild (#5427) * fix: package fleet-server using golang-crossbuild (#5392) * fix: package fleet-server using golang-crossbuild and introduce packaging steps on every PR * feat: save artifacts during packaging for DRA * fix: disable CGO and buildmode pie * doc: add changelog fragment (cherry picked from commit 7da3f69) # Conflicts: # .buildkite/pipeline.package.mbp.yml # .buildkite/pipeline.yml # .buildkite/scripts/package.sh # Dockerfile.fips # magefile.go * fix: adjust changes for make * fix: fleet-server-package-mbp CI step dependencies (#5446) (cherry picked from commit 5aa10ef) --------- Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
This was referenced Nov 14, 2025
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.





What is the problem this PR solves?
The
fleet-serverbinary was previously built directly on VM runners instead of using a controlled environment such asgolang-crossbuild.This caused the binary to be dynamically linked against the host system’s GLIBC, introducing higher GLIBC requirements (≥ 2.32) than those declared in the Elastic OS support matrix (≥ 2.17).
Note that, even if the build configuration used
CGO_ENABLED=0(which didn't before this PR) together with-buildmode=pie, on Linux, this combination still produces a dynamically linked binary becausepierelies on the dynamic loader (e.g./lib/ld-linux-aarch64.so.1on arm64).How does this PR solve the problem?
golang-crossbuildimages (viamage docker:release), avoiding linkage against host GLIBC.CGO_ENABLED=0across builds (except for FIPS variants, which require CGO).-buildmode=pieso that binaries are fully static, with no interpreter requirement.x86_64andarm64(including FIPS variants).build/distributions/**) for DRA validation and debugging.mage docker:imagewhen compiling FIPS variants.As a result, Fleet Server binaries are now fully static and do not have a GLIBC requirement, restoring compatibility with Amazon Linux 2 and other supported distributions.
For example, you can download the Linux packaging artifacts from the CI steps introduced in this PR:
Running
fileagainst them after extraction shows static binaries:How to test this PR locally
Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues