From e2b5cbdf1ffa942ad652e077aa8c718e58cb0132 Mon Sep 17 00:00:00 2001 From: Chris Koch Date: Sun, 27 Mar 2022 15:20:31 -0700 Subject: [PATCH] Build a new bazel docker image This is necessary because the new rules_go and gazelle versions require a version of bazel newer than what's in the GCR docker image pre-built by the bazel team. Apparently, they stopped building those in 2020. https://github.com/bazelbuild/continuous-integration/issues/1060 Signed-off-by: Chris Koch --- .circleci/config.yml | 6 +++--- .circleci/images/test-bazel/Dockerfile | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .circleci/images/test-bazel/Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 150a475e..b5287743 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,10 +36,10 @@ templates: bazel-template: &bazel-template docker: - - image: l.gcr.io/google/bazel:latest - working_directory: /go/bazel_gobusybox + - image: us-docker.pkg.dev/u-root-ci/gobusybox/test-bazel:v0.0.1 + working_directory: /home/circleci/go/bazel_gobusybox environment: - - GOPATH: "/go" + - GOPATH: "/home/circleci/go" resource_class: large build-gomod-template: &build-gomod-template diff --git a/.circleci/images/test-bazel/Dockerfile b/.circleci/images/test-bazel/Dockerfile new file mode 100644 index 00000000..63a6d807 --- /dev/null +++ b/.circleci/images/test-bazel/Dockerfile @@ -0,0 +1,11 @@ + +FROM cimg/base:2022.03 + +RUN sudo apt install apt-transport-https curl gnupg; \ + curl -fsSL https://bazel.build/bazel-release.pub.gpg | \ + gpg --dearmor > bazel.gpg; \ + sudo mv bazel.gpg /etc/apt/trusted.gpg.d/; \ + echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list; + +RUN sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends bazel;