Skip to content

Commit

Permalink
add aarch64 base for layer build (#40)
Browse files Browse the repository at this point in the history
* add aarch64 base for layer build

* ..
  • Loading branch information
aviramha authored Jan 21, 2025
1 parent 193d12d commit aa0232c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 15 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/layer-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
13 changes: 0 additions & 13 deletions layer-build/Dockerfile

This file was deleted.

25 changes: 25 additions & 0 deletions layer-build/aarch64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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

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 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
24 changes: 24 additions & 0 deletions layer-build/x86_64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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/x86_64-unknown-linux-gnu:main-centos

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 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

0 comments on commit aa0232c

Please sign in to comment.