File tree Expand file tree Collapse file tree
infrastructure/googleapis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,21 @@ RUN apt-get update && \
2727
2828RUN mkdir -p /tools
2929
30- # Download and install Bazelisk, a wrapper around Bazel.
31- ADD https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64 /tools/bazelisk
30+ # Bootstrap modern version of Go. The bookwork tag is associated with debian,
31+ # our base image, and the 1.26 tag is the Go minor version to capture rolling
32+ # patch updates for.
33+ COPY --from=golang:1.26-bookworm /usr/local/go /usr/local/go
34+
35+ # Build Bazelisk from source with modern version of Go to avoid using out of
36+ # date Go in the binary.
37+ # Removes the Go binary we installed previously so as to not leak it into
38+ # dependent jobs that may want to install their own version of Go.
39+ RUN export PATH="/usr/local/go/bin:${PATH}" && \
40+ git clone https://github.com/bazelbuild/bazelisk.git /tmp/bazelisk && \
41+ cd /tmp/bazelisk && \
42+ git checkout v${BAZELISK_VERSION} && \
43+ go build -o /tools/bazelisk && \
44+ rm -rf /tmp/bazelisk /usr/local/go
3245
3346ADD https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64 /tools/bazel
3447# Make the tools executable. These operations are performed in separate
You can’t perform that action at this time.
0 commit comments