-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Use multi-arch Docker images (#93)
- Loading branch information
Showing
4 changed files
with
78 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
FROM golang:1.22.6 | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_BRANCH | ||
|
||
|
||
FROM --platform=$BUILDPLATFORM golang:1.23.2 AS prepare | ||
|
||
RUN git clone https://go.googlesource.com/go /tmp/golang-tip | ||
|
||
# make sure that following steps are not cached; | ||
# mostly for local testing, not for GitHub Actions | ||
ARG CACHEBUST=1 | ||
RUN echo "$CACHEBUST" | ||
|
||
FROM golang:1.23.2 | ||
|
||
ARG GO_BRANCH | ||
RUN test -n "$GO_BRANCH" | ||
|
||
ENV GOLANG_VERSION=${GO_BRANCH} | ||
|
||
RUN cd /tmp/golang-tip && \ | ||
git reset --hard && \ | ||
git clean -xdf && \ | ||
git remote prune origin && \ | ||
git checkout "$GO_BRANCH" && \ | ||
git pull | ||
COPY --from=prepare /tmp/golang-tip /tmp/golang-tip | ||
|
||
RUN <<EOF | ||
set -ex | ||
|
||
test -n "$GOLANG_VERSION" | ||
|
||
cd /tmp/golang-tip | ||
git reset --hard | ||
git clean -xdf | ||
git remote prune origin | ||
git checkout "$GOLANG_VERSION" | ||
git pull | ||
|
||
# RUN cd /tmp/golang-tip/src && env GOROOT_FINAL=/usr/local/go ./all.bash | ||
# TODO https://github.com/AlekSi/golang-tip/issues/3 | ||
RUN cd /tmp/golang-tip/src && env GOROOT_FINAL=/usr/local/go ./make.bash | ||
cd /tmp/golang-tip/src | ||
env GOROOT_FINAL=/usr/local/go ./make.bash | ||
|
||
RUN cd / && \ | ||
rm -fr /usr/local/go && \ | ||
rm -fr /tmp/golang-tip/.git && \ | ||
mv -v /tmp/golang-tip /usr/local/go && \ | ||
go version | ||
cd / | ||
rm -fr /usr/local/go | ||
rm -fr /tmp/golang-tip/.git | ||
mv /tmp/golang-tip /usr/local/go | ||
go version | ||
|
||
# to save time to users | ||
RUN go install -v -race std && \ | ||
go install -v std && \ | ||
go clean -cache | ||
go clean -cache | ||
go install -race std | ||
go install std | ||
|
||
EOF | ||
|
||
LABEL org.opencontainers.image.title="Daily builds of active Go development branches" | ||
LABEL org.opencontainers.image.title="Daily builds of active Go development branches (branch ${GO_BRANCH})" | ||
LABEL org.opencontainers.image.url=https://github.com/AlekSi/golang-tip | ||
LABEL org.opencontainers.image.source=https://github.com/AlekSi/golang-tip |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/AlekSi/golang-tip | ||
|
||
go 1.22 | ||
go 1.23 | ||
|
||
toolchain go1.22.6 | ||
toolchain go1.23.2 |