-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Switch base docker image from golang-alpine to ubuntu:20.04 #3882
Conversation
0175e46
to
9f796dc
Compare
|
||
# Disable cgo when building in the container. This will create a static binary, which can be | ||
# copied and run in the base alpine container without the libc/musl runtime. | ||
ENV CGO_ENABLED 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove static compilation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The static link in docker was only added to work around the SIGSEGVs in alpine. Now with the build in Docker and with the matching libc runtime FROM ubuntu, the static build is no longer required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling binary statically has another side effect of having all dependencies compiled into binary, ensuring the resulting executable is assembled and equipped with all dependencies it was compiled with, ensuring consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@C0rWin are you proposing that we change the make
target to generate a static executable? I thought we had settled on the use of Docker to establish consistency across runtimes. Recall that the above update ENV CGO_ENABLED 0
was new behavior introduced in the release 2.5 alpha builds for alpine - the behavior in this PR reverts to the same mechanisms we've been using in Fabric since ~2017, with the primary difference that the base Docker image is now derived from ubuntu. Running with the ubuntu / gnu libc seems to have resolved all of the errors encountered with alpine's musl runtime.
Also:
-
Formal release binaries are static, generated with the golang cross-compiler.
-
Changing the default
make
target to a static build will cause major issues for the pkcs11 runtimes.
9f796dc
to
1fbbb10
Compare
Looks like ubuntu:20.04 has been on a tighter diet than debian:slim. This is on the arm64 - also on amd64 the debian images are a few MB larger.
|
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
1fbbb10
to
b5120ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is general agreement in the Discussion on the approach. Let's give it a try!
@Mergifyio backport main |
✅ Backports have been created
|
Type of change
Description
This PR switches the Fabric base docker images from golang-alpine to ubuntu:20.04. The upgrade is necessary as the golang-alpine libc runtimes (musl) are incompatible with the requirements on multi-arch runtimes.
The motivations for this upgrade are described in detail in Discussion #3876 and comments in DRAFT PR #3877
Additional details
Related issues