Skip to content

Commit ecca9dc

Browse files
authored
ci: use latest stable Go version for the mostly static binary (#1558)
* ci: use latest stable Go version for the mostly static binary * fix
1 parent eb40c03 commit ecca9dc

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

docker-bake.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ target "static-builder-gnu" {
163163
}
164164
args = {
165165
FRANKENPHP_VERSION = VERSION
166+
GO_VERSION = GO_VERSION
166167
}
167168
secret = ["id=github-token,env=GITHUB_TOKEN"]
168169
}

static-builder-gnu.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ ARG DEBUG_SYMBOLS=''
2121
ARG MIMALLOC=''
2222
ARG NO_COMPRESS=''
2323

24-
# go version
24+
# Go
25+
ARG GO_VERSION
2526
ENV GOTOOLCHAIN=local
26-
ENV GO_VERSION=1.24.3
2727

2828
# labels, same as static-builder.Dockerfile
2929
LABEL org.opencontainers.image.title=FrankenPHP
@@ -97,10 +97,10 @@ RUN yum install -y \
9797
fi ; \
9898
curl -o /usr/local/bin/jq -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${GO_ARCH} && \
9999
chmod +x /usr/local/bin/jq && \
100-
curl -o go.tgz -fsSL https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
100+
curl -o go.tar.gz -fsSL https://go.dev/dl/$(curl -fsS https://go.dev/dl/?mode=json | jq -r "first(first(.[] | select(.stable and (.version | startswith(\"go${GO_VERSION}\")))).files[] | select(.os == \"linux\" and (.kind == \"archive\") and (.arch == \"${GO_ARCH}\"))).filename") && \
101101
rm -rf /usr/local/go && \
102-
tar -C /usr/local -xzf go.tgz && \
103-
rm go.tgz && \
102+
tar -C /usr/local -xzf go.tar.gz && \
103+
rm go.tar.gz && \
104104
/usr/local/go/bin/go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
105105

106106
ENV PATH="/cmake/bin:/usr/local/go/bin:$PATH"

0 commit comments

Comments
 (0)