-
Notifications
You must be signed in to change notification settings - Fork 542
golang: Build 1.25.0 images - take #2 (copy golang binaries from golang alpine image) #4119
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ | |
| # platform go binary for the architecture kubernetes cares about. | ||
|
|
||
| ARG BASEIMAGE | ||
| ARG GO_VERSION | ||
| FROM golang:${GO_VERSION}-alpine as go-source | ||
| FROM ${BASEIMAGE} | ||
|
|
||
| ##------------------------------------------------------------ | ||
|
|
@@ -40,6 +42,12 @@ ENV KUBE_CROSSPLATFORMS \ | |
| windows/amd64 windows/386 | ||
|
|
||
| ##------------------------------------------------------------ | ||
| COPY --from=go-source /usr/local/go /usr/local/go | ||
| ENV PATH=/usr/local/go/bin:$PATH | ||
| ENV GOROOT=/usr/local/go | ||
| ENV GOLANG_VERSION=${GO_VERSION} | ||
| ENV GOTOOLCHAIN=local | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be auto
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. however, this also aligns with the golang image (which we use as a base) which also defaults to local ... :/ local means "always use my local version" ... which may defeat the .go-version logic
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have this issue in most of our golang: image based environments. sent #4215 to start |
||
| ENV GOPATH=/usr/local/go | ||
|
|
||
| # Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+ | ||
| RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \ | ||
|
|
@@ -52,12 +60,17 @@ fi | |
| RUN apt-get -q update \ | ||
| && apt-get install -qqy \ | ||
| apt-utils \ | ||
| curl \ | ||
| file \ | ||
| git \ | ||
| gnupg2 \ | ||
| iproute2 \ | ||
| jq \ | ||
| openssh-client \ | ||
| patch \ | ||
| rsync \ | ||
| unzip \ | ||
| iproute2 | ||
| wget | ||
|
|
||
| # Use dynamic cgo linking for architectures other than amd64 for the server platforms | ||
| # To install crossbuild essential for other architectures add the following repository. | ||
|
|
||
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.
@dims the image changes from this file needs to be promoted, do you want to take care of that?
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.
@saschagrunert yes of course