Skip to content

Commit

Permalink
Add experimental ARM64 Linux support (#1493)
Browse files Browse the repository at this point in the history
The basic idea is to publish multi-arch Docker images, and then run the
ARM64 images on the newly added Tau T2A VMs.

I'm adding separate build/push scripts to not affect the existing
images, since this change needs more testing. That's also why it only
adds machines to the testing org, and why I'm merging this commit into
the testing branch for now.

Progress towards #1112 and #1402
  • Loading branch information
fweikert authored Nov 11, 2022
1 parent 79bc5f9 commit 85923b8
Show file tree
Hide file tree
Showing 16 changed files with 223 additions and 46 deletions.
37 changes: 34 additions & 3 deletions buildkite/create_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

DEBUG = False

DEFAULT_MACHINE_TYPE = "c2-standard-8"
DEFAULT_BOOT_DISK_SIZE = "500GB"

IMAGE_CREATION_VMS = {
"bk-testing-docker": {
"project": "bazel-public",
Expand All @@ -40,6 +43,20 @@
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
],
},
"bk-testing-docker-arm64": {
"project": "bazel-public",
"zone": "us-central1-f",
"source_image_project": "ubuntu-os-cloud",
"source_image_family": "ubuntu-2004-lts-arm64",
"setup_script": "setup-docker.sh",
"guest_os_features": ["VIRTIO_SCSI_MULTIQUEUE"],
"licenses": [
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
],
# https://cloud.google.com/compute/docs/instances/create-arm-vm-instance#armpublicimage
"machine_type": "t2a-standard-8",
"network_interface": "nic-type=GVNIC",
},
"bk-testing-windows": {
"project": "bazel-public",
"zone": "us-central1-f",
Expand Down Expand Up @@ -97,16 +114,30 @@ def create_instance(instance_name, params):
"image-family": params["source_image_family"],
}

network_params = {}
if "network_interface" in params:
if "network" in params:
print(
f"Config error: {instance_name} has both 'network' and "
"'network_interface', which are mutually exclusive.",
file=sys.stdout,
)
exit(1)

network_params["network_interface"] = params["network_interface"]
else:
network_params["network"] = (params.get("network", "default"),)

gcloud.create_instance(
instance_name,
project=params["project"],
zone=params["zone"],
machine_type="c2-standard-8",
network=params.get("network", "default"),
machine_type=params.get("machine_type", DEFAULT_MACHINE_TYPE),
metadata_from_file=startup_script,
boot_disk_type="pd-ssd",
boot_disk_size=params.get("boot_disk_size", "500GB"),
boot_disk_size=params.get("boot_disk_size", DEFAULT_BOOT_DISK_SIZE),
**image,
**network_params,
)
finally:
os.remove(setup_script)
Expand Down
39 changes: 39 additions & 0 deletions buildkite/docker/build_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# TODO(fweikert): merge this file into build.sh once ARM64 support is no longer experimental

set -euxo pipefail

case $(git symbolic-ref --short HEAD) in
master)
PREFIX="bazel-public"
;;
testing)
PREFIX="bazel-public/testing"
;;
*)
echo "You must build Docker images either from the master or the testing branch!"
exit 1
esac

docker buildx builder prune -a -f
docker buildx buildx create --name cibuilder --use

# Containers used by Bazel CI
docker buildx build -f centos7/Dockerfile --target centos7 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7" centos7 &
docker buildx build -f debian10/Dockerfile --target debian10-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/debian10-java11" debian10 &
docker buildx build -f debian11/Dockerfile --target debian11-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/debian11-java17" debian11 &
docker buildx build -f ubuntu1604/Dockerfile --target ubuntu1604-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1604-java8" ubuntu1604 &
docker buildx build -f ubuntu1804/Dockerfile --target ubuntu1804-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1804-java11" ubuntu1804 &
docker buildx build -f ubuntu2004/Dockerfile --target ubuntu2004-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-java11" ubuntu2004 &
docker buildx build -f ubuntu2204/Dockerfile --target ubuntu2204-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2204-java17" ubuntu2204 &
wait

docker buildx build -f centos7/Dockerfile --target centos7-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java8" centos7
docker buildx build -f centos7/Dockerfile --target centos7-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java11" centos7
docker buildx build -f centos7/Dockerfile --target centos7-java11-devtoolset10 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java11-devtoolset10" centos7
docker buildx build -f centos7/Dockerfile --target centos7-releaser --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-releaser" centos7
docker buildx build -f ubuntu1604/Dockerfile --target ubuntu1604-bazel-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1604-bazel-java8" ubuntu1604
docker buildx build -f ubuntu1804/Dockerfile --target ubuntu1804-bazel-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1804-bazel-java11" ubuntu1804
docker buildx build -f ubuntu2004/Dockerfile --target ubuntu2004-bazel-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-bazel-java11" ubuntu2004
docker buildx build -f ubuntu2004/Dockerfile --target ubuntu2004-java11-kythe --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-java11-kythe" ubuntu2004
docker buildx build -f ubuntu2204/Dockerfile --target ubuntu2204-bazel-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2204-bazel-java17" ubuntu2204
14 changes: 10 additions & 4 deletions buildkite/docker/centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM centos:7 as centos7
ARG BUILDARCH
ARG TARGETARCH

# Install required packages.
COPY google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo
Expand Down Expand Up @@ -48,13 +48,13 @@ RUN localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1

# Bazelisk
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/bazel && \
chmod 0755 /usr/local/bin/bazel

# Buildifier
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/buildifier && \
chmod 0755 /usr/local/bin/buildifier

Expand All @@ -64,9 +64,15 @@ RUN yum install -y java-1.8.0-openjdk-devel && yum clean all
FROM centos7 AS centos7-java11

# Unfortunately Azul doesn't publish an RPM package for zulu11 on aarch64, so we have to use the tar.gz version.
RUN
RUN mkdir -p /usr/lib/jvm/zulu-11 && \
pushd /usr/lib/jvm/zulu-11 && \
curl "https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz" | tar xvz --strip-components=1 && \
if [ "$TARGETARCH" = "arm64" ]; then \
export DOWNLOAD_URL="https://cdn.azul.com/zulu-embedded/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_aarch64.tar.gz" ; \
else \
export DOWNLOAD_URL="https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jdk11.0.16.1-linux_x64.tar.gz" ; \
fi; \
curl "$DOWNLOAD_URL" | tar xvz --strip-components=1 && \
update-alternatives \
--install /usr/bin/java java /usr/lib/jvm/zulu-11/bin/java 2115200 \
--slave /usr/bin/jaotc jaotc /usr/lib/jvm/zulu-11/bin/jaotc \
Expand Down
10 changes: 5 additions & 5 deletions buildkite/docker/debian10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM debian:10 as debian10-java11
ARG BUILDARCH
ARG TARGETARCH

ENV DEBIAN_FRONTEND="noninteractive"
ENV LANG "C.UTF-8"
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN apt-get -y update && \
# Allow using sudo inside the container.
RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-${BUILDARCH}
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-${TARGETARCH}

### Install Google Cloud SDK.
### https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
Expand All @@ -69,19 +69,19 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.c
RUN apt-get -y update && \
apt-get -y install apt-transport-https ca-certificates && \
curl -sSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
add-apt-repository "deb [arch=$BUILDARCH] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
apt-get -y update && \
apt-get -y install docker-ce && \
rm -rf /var/lib/apt/lists/*

# Bazelisk
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/bazel && \
chmod 0755 /usr/local/bin/bazel

# Buildifier
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/buildifier && \
chmod 0755 /usr/local/bin/buildifier
10 changes: 5 additions & 5 deletions buildkite/docker/debian11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM debian:11 as debian11-java17
ARG BUILDARCH
ARG TARGETARCH

ENV DEBIAN_FRONTEND="noninteractive"
ENV LANG "C.UTF-8"
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN apt-get -y update && \
# Allow using sudo inside the container.
RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-${BUILDARCH}
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-${TARGETARCH}

### Install Google Cloud SDK.
### https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
Expand All @@ -69,19 +69,19 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.c
RUN apt-get -y update && \
apt-get -y install apt-transport-https ca-certificates && \
curl -sSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
add-apt-repository "deb [arch=$BUILDARCH] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
apt-get -y update && \
apt-get -y install docker-ce && \
rm -rf /var/lib/apt/lists/*

# Bazelisk
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/bazel && \
chmod 0755 /usr/local/bin/bazel

# Buildifier
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/buildifier && \
chmod 0755 /usr/local/bin/buildifier
39 changes: 39 additions & 0 deletions buildkite/docker/push_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# TODO(fweikert): merge this file into push.sh once ARM64 support is no longer experimental

set -euxo pipefail

case $(git symbolic-ref --short HEAD) in
master)
PREFIX="bazel-public"
;;
testing)
PREFIX="bazel-public/testing"
;;
*)
echo "You must build Docker images either from the master or the testing branch!"
exit 1
esac

docker buildx builder prune -a -f
docker buildx buildx create --name cibuilder --use

# Containers used by Bazel CI
docker buildx build --push -f centos7/Dockerfile --target centos7 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7" centos7 &
docker buildx build --push -f debian10/Dockerfile --target debian10-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/debian10-java11" debian10 &
docker buildx build --push -f debian11/Dockerfile --target debian11-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/debian11-java17" debian11 &
docker buildx build --push -f ubuntu1604/Dockerfile --target ubuntu1604-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1604-java8" ubuntu1604 &
docker buildx build --push -f ubuntu1804/Dockerfile --target ubuntu1804-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1804-java11" ubuntu1804 &
docker buildx build --push -f ubuntu2004/Dockerfile --target ubuntu2004-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-java11" ubuntu2004 &
docker buildx build --push -f ubuntu2204/Dockerfile --target ubuntu2204-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2204-java17" ubuntu2204 &
wait

docker buildx build --push -f centos7/Dockerfile --target centos7-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java8" centos7
docker buildx build --push -f centos7/Dockerfile --target centos7-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java11" centos7
docker buildx build --push -f centos7/Dockerfile --target centos7-java11-devtoolset10 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-java11-devtoolset10" centos7
docker buildx build --push -f centos7/Dockerfile --target centos7-releaser --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/centos7-releaser" centos7
docker buildx build --push -f ubuntu1604/Dockerfile --target ubuntu1604-bazel-java8 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1604-bazel-java8" ubuntu1604
docker buildx build --push -f ubuntu1804/Dockerfile --target ubuntu1804-bazel-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu1804-bazel-java11" ubuntu1804
docker buildx build --push -f ubuntu2004/Dockerfile --target ubuntu2004-bazel-java11 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-bazel-java11" ubuntu2004
docker buildx build --push -f ubuntu2004/Dockerfile --target ubuntu2004-java11-kythe --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2004-java11-kythe" ubuntu2004
docker buildx build --push -f ubuntu2204/Dockerfile --target ubuntu2204-bazel-java17 --platform linux/arm64,linux/amd64 -t "gcr.io/$PREFIX/ubuntu2204-bazel-java17" ubuntu2204
10 changes: 5 additions & 5 deletions buildkite/docker/ubuntu1604/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:16.04 as ubuntu1604-bazel-java8
ARG BUILDARCH
ARG TARGETARCH

ENV DEBIAN_FRONTEND="noninteractive"
ENV LANG "C.UTF-8"
Expand Down Expand Up @@ -55,7 +55,7 @@ RUN apt-get -y update && \
# Allow using sudo inside the container.
RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-${BUILDARCH}
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-${TARGETARCH}

FROM ubuntu1604-bazel-java8 AS ubuntu1604-java8

Expand Down Expand Up @@ -87,19 +87,19 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.c
RUN apt-get -y update && \
apt-get -y install apt-transport-https ca-certificates && \
curl -sSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=$BUILDARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get -y update && \
apt-get -y install docker-ce && \
rm -rf /var/lib/apt/lists/*

# Bazelisk
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/bazel && \
chmod 0755 /usr/local/bin/bazel

# Buildifier
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/buildifier && \
chmod 0755 /usr/local/bin/buildifier
10 changes: 5 additions & 5 deletions buildkite/docker/ubuntu1804/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:18.04 as ubuntu1804-bazel-java11
ARG BUILDARCH
ARG TARGETARCH

ENV DEBIAN_FRONTEND="noninteractive"
ENV LANG "C.UTF-8"
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN apt-get -y update && \
# Allow using sudo inside the container.
RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-${BUILDARCH}
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-${TARGETARCH}

FROM ubuntu1804-bazel-java11 AS ubuntu1804-java11

Expand All @@ -71,19 +71,19 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.c
RUN apt-get -y update && \
apt-get -y install apt-transport-https ca-certificates && \
curl -sSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=$BUILDARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get -y update && \
apt-get -y install docker-ce && \
rm -rf /var/lib/apt/lists/*

# Bazelisk
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/bazel && \
chmod 0755 /usr/local/bin/bazel

# Buildifier
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${TARGETARCH} && \
chown root:root /usr/local/bin/buildifier && \
chmod 0755 /usr/local/bin/buildifier
Loading

0 comments on commit 85923b8

Please sign in to comment.