]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Fixing multi-arch container builds
authorAmir Zarrinkafsh <nightah@me.com>
Wed, 20 May 2020 05:31:02 +0000 (15:31 +1000)
committerAmir Zarrinkafsh <nightah@me.com>
Wed, 20 May 2020 05:31:02 +0000 (15:31 +1000)
Dockerfile.arm32v7
Dockerfile.arm64v8
hooks/post_push

index 58a1834a2db57fb1900e959f00346b6044e5c2c8..12322d41019edc3010c4128385d85bc8049bab4e 100644 (file)
@@ -1,6 +1,12 @@
+FROM alpine as qemu
+
+ARG QEMU_VERSION "v4.2.0-7"
+
+RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-arm-static && chmod +x qemu-arm-static
+
 FROM arm32v7/alpine:3.11
-COPY qemu-arm-static /usr/bin
 
+COPY --from=qemu qemu-arm-static /usr/bin/
 COPY ./ /www/
 
 ENV USER darkhttpd
@@ -9,7 +15,8 @@ ENV GID 911
 ENV UID 911
 
 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
-    apk add -U darkhttpd
+    apk add -U darkhttpd && \
+    rm /usr/bin/qemu-arm-static
 
 USER darkhttpd
 
index 69132a3638b6c357fceceee1ab2ccda3df25ab7a..490a109a152c8c20d5e8fa3bae2b1d3c9d2b41e7 100644 (file)
@@ -1,6 +1,12 @@
+FROM alpine as qemu
+
+ARG QEMU_VERSION "v4.2.0-7"
+
+RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-aarch64-static && chmod +x qemu-aarch64-static
+
 FROM arm64v8/alpine:3.11
-COPY qemu-arm-static /usr/bin
 
+COPY --from=qemu qemu-aarch64-static /usr/bin/
 COPY ./ /www/
 
 ENV USER darkhttpd
@@ -9,7 +15,8 @@ ENV GID 911
 ENV UID 911
 
 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
-    apk add -U darkhttpd
+    apk add -U darkhttpd && \
+    rm /usr/bin/qemu-aarch64-static
 
 USER darkhttpd
 
index 08384f3877c381637c91b4f383de8ff499e8a394..d721b68568aef5e7a6b1b276496d90deb6504c6d 100644 (file)
@@ -1,10 +1,5 @@
 #!/bin/bash
 
-#!/bin/bash
-# downloads a local copy of qemu on docker-hub build machines
-curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .
-
-
 docker manifest push --purge b4bz/homer:latest
 docker manifest create b4bz/homer:latest b4bz/homer:latest-amd64 b4bz/homer:latest-arm32v7 b4bz/homer:latest-arm64v8
 docker manifest annotate b4bz/homer:latest b4bz/homer:latest-arm32v7 --os linux --arch arm