-
Notifications
You must be signed in to change notification settings - Fork 368
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
[release-1.27] Use go with alpine 3.18 (#3351) #3384
Conversation
The 3.18 includes a fix for a bug in musl libc when there is a `search .` in /etc/resolv.conf. Fixes: k0sproject#3351 Ref: https://www.openwall.com/lists/musl/2022/08/31/5 Signed-off-by: Natanael Copa <[email protected]>
@@ -1,6 +1,6 @@ | |||
alpine_version = 3.17 | |||
alpine_patch_version = $(alpine_version).4 | |||
golang_buildimage=docker.io/library/golang:$(go_version)-alpine$(alpine_version) | |||
golang_buildimage=docker.io/library/golang:$(go_version)-alpine3.18 |
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 only on build image, why not on the general alpine version on line 1?
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 problem only affects go compiler. We link statically with CGO_ENABLED=1.
We use alpine 3.17 other places and I thought it would be good to be conservative and continue with that for the stable branch.
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.
Another option to fix this is to explicitly request netgo, like this:
diff --git a/Makefile b/Makefile
index abc282d32..c7c7d9457 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ EMBEDDED_BINS_BUILDMODE ?= docker
TARGET_OS ?= linux
BUILD_UID ?= $(shell id -u)
BUILD_GID ?= $(shell id -g)
-BUILD_GO_FLAGS := -tags osusergo
+BUILD_GO_FLAGS := -tags netgo,osusergo
BUILD_GO_LDFLAGS_EXTRA :=
DEBUG ?= false
Backporting to release-1.26 for #3912. |
Backport failed for Please cherry-pick the changes locally. git fetch origin release-1.26
git worktree add -d .worktree/backport-3384-to-release-1.26 origin/release-1.26
cd .worktree/backport-3384-to-release-1.26
git checkout -b backport-3384-to-release-1.26
ancref=$(git merge-base da6987e9a1d3cf3c5f0b0707b479a00837d02972 1217281f787afed3e71abd1f6d554d043c27c453)
git cherry-pick -x $ancref..1217281f787afed3e71abd1f6d554d043c27c453 |
Description
Fixes #3351
Type of change
How Has This Been Tested?
Checklist: