From cc8dda7e3c7e80359202370df4f29fcf7e6d4149 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 3 Sep 2024 01:36:45 -0700 Subject: [PATCH 1/2] feat: multi-arch and multi-os build --- bazel/oci/Dockerfile | 2 +- bazel/oci/install_bazel.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/oci/Dockerfile b/bazel/oci/Dockerfile index f99995a356..7032a5e690 100644 --- a/bazel/oci/Dockerfile +++ b/bazel/oci/Dockerfile @@ -8,7 +8,7 @@ RUN --mount=source=bazel/oci/install_packages.sh,target=/mnt/install_packages.sh FROM base_image AS downloader -ARG BAZEL_VERSION +ARG TARGETOS TARGETARCH BAZEL_VERSION WORKDIR /var/bazel RUN --mount=source=bazel/oci/install_bazel.sh,target=/mnt/install_bazel.sh,type=bind \ diff --git a/bazel/oci/install_bazel.sh b/bazel/oci/install_bazel.sh index c2e1ba400c..788c2236cb 100755 --- a/bazel/oci/install_bazel.sh +++ b/bazel/oci/install_bazel.sh @@ -6,13 +6,13 @@ curl \ --fail \ --location \ --remote-name \ - "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64" + "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}" curl \ --fail \ --location \ - "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64.sha256" \ + "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}.sha256" \ | sha256sum --check -mv "bazel-${BAZEL_VERSION}-linux-x86_64" bazel +mv "bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}" bazel chmod +x bazel From 324461887ef876b5ff5bc31f4da4c4a40696dcca Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 3 Sep 2024 01:48:44 -0700 Subject: [PATCH 2/2] fix: only multi-arch needed --- bazel/oci/Dockerfile | 2 +- bazel/oci/install_bazel.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/oci/Dockerfile b/bazel/oci/Dockerfile index 7032a5e690..036f9de70c 100644 --- a/bazel/oci/Dockerfile +++ b/bazel/oci/Dockerfile @@ -8,7 +8,7 @@ RUN --mount=source=bazel/oci/install_packages.sh,target=/mnt/install_packages.sh FROM base_image AS downloader -ARG TARGETOS TARGETARCH BAZEL_VERSION +ARG TARGETARCH BAZEL_VERSION WORKDIR /var/bazel RUN --mount=source=bazel/oci/install_bazel.sh,target=/mnt/install_bazel.sh,type=bind \ diff --git a/bazel/oci/install_bazel.sh b/bazel/oci/install_bazel.sh index 788c2236cb..f5b0e47671 100755 --- a/bazel/oci/install_bazel.sh +++ b/bazel/oci/install_bazel.sh @@ -6,13 +6,13 @@ curl \ --fail \ --location \ --remote-name \ - "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}" + "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-${TARGETARCH}" curl \ --fail \ --location \ - "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}.sha256" \ + "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-${TARGETARCH}.sha256" \ | sha256sum --check -mv "bazel-${BAZEL_VERSION}-${TARGETOS}-${TARGETARCH}" bazel +mv "bazel-${BAZEL_VERSION}-linux-${TARGETARCH}" bazel chmod +x bazel