Support AArch64

This commit is contained in:
Stefan Agner 2019-01-23 01:08:08 +01:00
parent 8dfabe4056
commit c03280b09e
5 changed files with 37 additions and 3 deletions

View file

@ -5,13 +5,18 @@ go:
- stable
services:
- docker
env:
- BUILD_ARCH=arm32v7
- BUILD_ARCH=arm64v8
install:
- go get github.com/estesp/manifest-tool
- 'echo ''{ "experimental": true }'' | sudo tee /etc/docker/daemon.json'
- sudo systemctl restart docker
- sudo apt-get --yes --no-install-recommends install qemu-user-static
- sudo su -c 'echo -1 > /proc/sys/fs/binfmt_misc/qemu-arm'
- sudo su -c 'echo -1 > /proc/sys/fs/binfmt_misc/qemu-aarch64'
- echo ':qemu-arm:M:0:\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:CF' | sudo tee -a /proc/sys/fs/binfmt_misc/register
- echo ':qemu-aarch64:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:CF' | sudo tee -a /proc/sys/fs/binfmt_misc/register
script:
- ./build
after_success:

28
Dockerfile.arm64v8 Normal file
View file

@ -0,0 +1,28 @@
FROM agners/archlinuxarm-arm64v8
WORKDIR /archlinux
RUN mkdir -p /archlinux/rootfs
COPY pacstrap-docker /archlinux/
RUN pacman-key --init
RUN pacman-key --populate archlinuxarm
RUN ./pacstrap-docker /archlinux/rootfs \
bash sed gzip pacman
# Remove current pacman database, likely outdated very soon
RUN rm rootfs/var/lib/pacman/sync/*
FROM scratch
COPY --from=0 /archlinux/rootfs/ /
COPY rootfs/ /
ENV LANG=en_US.UTF-8
RUN locale-gen
RUN pacman-key --init
RUN pacman-key --populate archlinuxarm
CMD ["/usr/bin/bash"]

5
build
View file

@ -1,11 +1,12 @@
#!/bin/bash -ex
DOCKER_ARCH=arm32v7
DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
DOCKER_ORG=agners
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}
TAG_DATE=$(date +'%Y%m%d')
docker build -t $DOCKER_ORG/$DOCKER_IMAGE \
-t $DOCKER_ORG/$DOCKER_IMAGE:$TAG_DATE .
-t $DOCKER_ORG/$DOCKER_IMAGE:$TAG_DATE \
-f Dockerfile.${DOCKER_ARCH} .

2
push
View file

@ -1,6 +1,6 @@
#!/bin/bash -ex
DOCKER_ARCH=arm32v7
DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
DOCKER_ORG=agners
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}