From 369443c226e10d76d1aafa7f50373f80dead427b Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Tue, 21 Jan 2025 08:54:57 +0200 Subject: [PATCH 1/2] add aarch64 base for layer build --- .github/workflows/layer-build.yaml | 13 +++++++++++-- layer-build/aarch64.Dockerfile | 13 +++++++++++++ layer-build/{Dockerfile => x86_64.Dockerfile} | 0 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 layer-build/aarch64.Dockerfile rename layer-build/{Dockerfile => x86_64.Dockerfile} (100%) diff --git a/.github/workflows/layer-build.yaml b/.github/workflows/layer-build.yaml index 214a967..d4a1bd9 100644 --- a/.github/workflows/layer-build.yaml +++ b/.github/workflows/layer-build.yaml @@ -28,8 +28,17 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: layer-build/Dockerfile + file: layer-build/x86_64.Dockerfile platforms: linux/amd64 push: true tags: | - ghcr.io/metalbear-co/ci-layer-build:latest \ No newline at end of file + ghcr.io/metalbear-co/ci-layer-build:latest + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: layer-build/aarch64.Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/metalbear-co/ci-layer-build-aarch64:latest \ No newline at end of file diff --git a/layer-build/aarch64.Dockerfile b/layer-build/aarch64.Dockerfile new file mode 100644 index 0000000..33551c6 --- /dev/null +++ b/layer-build/aarch64.Dockerfile @@ -0,0 +1,13 @@ +# Dockerfile used for building mirrord-layer for x64 with very old libc +# this to support centos7 or Amazon Linux 2. + +FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos + +# This fails to compile but tbh shouldn't really change so just stick with old always T_T +RUN yum update -y && \ + yum install centos-release-scl -y && \ + yum install llvm-toolset-7 -y + +ENV LIBCLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ \ + LIBCLANG_STATIC_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ \ + CLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/bin/clang \ No newline at end of file diff --git a/layer-build/Dockerfile b/layer-build/x86_64.Dockerfile similarity index 100% rename from layer-build/Dockerfile rename to layer-build/x86_64.Dockerfile From d5dc5b1744b4a1c6ac69ad7481225471eaaf9d70 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Tue, 21 Jan 2025 11:02:36 +0200 Subject: [PATCH 2/2] .. --- layer-build/aarch64.Dockerfile | 18 +++++++++++++++--- layer-build/x86_64.Dockerfile | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/layer-build/aarch64.Dockerfile b/layer-build/aarch64.Dockerfile index 33551c6..042ec3b 100644 --- a/layer-build/aarch64.Dockerfile +++ b/layer-build/aarch64.Dockerfile @@ -1,11 +1,23 @@ -# Dockerfile used for building mirrord-layer for x64 with very old libc +# Dockerfile used for building mirrord-layer for aarch64 with very old libc # this to support centos7 or Amazon Linux 2. FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos -# This fails to compile but tbh shouldn't really change so just stick with old always T_T +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + + +RUN yum update -y && \ + yum install centos-release-scl -y + +# centos-release-scl adds another repo so need to patch again +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + + RUN yum update -y && \ - yum install centos-release-scl -y && \ yum install llvm-toolset-7 -y ENV LIBCLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ \ diff --git a/layer-build/x86_64.Dockerfile b/layer-build/x86_64.Dockerfile index 6712f95..b011c08 100644 --- a/layer-build/x86_64.Dockerfile +++ b/layer-build/x86_64.Dockerfile @@ -3,9 +3,20 @@ FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos -# This fails to compile but tbh shouldn't really change so just stick with old always T_T +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + + +RUN yum update -y && \ + yum install centos-release-scl -y + +# centos-release-scl adds another repo so need to patch again +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + RUN yum update -y && \ - yum install centos-release-scl -y && \ yum install llvm-toolset-7 -y ENV LIBCLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ \