# Enable emulation for cross-platform images
sudo apt-get install -y binfmt-support qemu-user-static
# Enable cross-build commands in docker
docker buildx create --use
Build glibc binaries for ARM64
git clone https://github.com/sgerrand/docker-glibc-builder
cd docker-glibc-builder
docker buildx build --platform linux/arm64,linux/amd64 -t ljfranklin/glibc-builder:latest --push .
docker run --platform linux/arm64 --rm --env STDOUT=1 ljfranklin/glibc-builder:latest 2.32 /usr/glibc-compat > glibc-bin-2.32-0-aarch64.tar.gz
cd ..
Build glibc APK for ARM64
git clone https://github.com/andyshinn/docker-alpine-abuild
cd docker-alpine-abuild
docker buildx build --platform linux/arm64,linux/amd64 -t ljfranklin/alpine-abuild:latest --push .
cd ..
mkdir keys
openssl genrsa -out keys/ljfranklin-glibc 2048
openssl rsa -in keys/ljfranklin-glibc -pubout > keys/ljfranklin-glibc.pub
git clone --branch arm64 https://github.com/ljfranklin/alpine-pkg-glibc
cd alpine-pkg-glibc
docker run -it \
-e RSA_PRIVATE_KEY="$(cat ../keys/ljfranklin-glibc)" \
-e RSA_PRIVATE_KEY_NAME="ljfranklin-glibc" \
-v "$PWD:/home/builder/package" \
-v "$HOME/.abuild/packages:/packages" \
-v "../keys/ljfranklin-glibc.pub:/etc/apk/keys/ljfranklin-glibc.pub" \
--platform linux/arm64 \
ljfranklin/alpine-abuild:latest
ls ~/.abuild/packages/builder/aarch64/*.apk