From abe6df52b500199ff4b379e0370427267a16992b Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Fri, 8 May 2020 21:59:39 +1000 Subject: [PATCH] Build multi-arch container with manifest --- Dockerfile.arm32v7 | 15 +++++++++++++++ Dockerfile.arm64v8 | 15 +++++++++++++++ hooks/post_push | 7 +++++++ hooks/pre_build | 8 ++++++++ 4 files changed, 45 insertions(+) create mode 100644 Dockerfile.arm32v7 create mode 100644 Dockerfile.arm64v8 create mode 100644 hooks/post_push create mode 100644 hooks/pre_build diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 new file mode 100644 index 0000000..79a7a61 --- /dev/null +++ b/Dockerfile.arm32v7 @@ -0,0 +1,15 @@ +FROM arm32v7/alpine:3.11 + +COPY ./ /www/ + +ENV USER darkhttpd +ENV GROUP darkhttpd +ENV GID 911 +ENV UID 911 + +RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ + apk add -U darkhttpd + +USER darkhttpd + +ENTRYPOINT ["darkhttpd","/www/"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 0000000..707dd83 --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,15 @@ +FROM arm64v8/alpine:3.11 + +COPY ./ /www/ + +ENV USER darkhttpd +ENV GROUP darkhttpd +ENV GID 911 +ENV UID 911 + +RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ + apk add -U darkhttpd + +USER darkhttpd + +ENTRYPOINT ["darkhttpd","/www/"] diff --git a/hooks/post_push b/hooks/post_push new file mode 100644 index 0000000..d721b68 --- /dev/null +++ b/hooks/post_push @@ -0,0 +1,7 @@ +#!/bin/bash + +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 +docker manifest annotate b4bz/homer:latest b4bz/homer:latest-arm64v8 --os linux --arch arm64 --variant v8 +docker manifest push --purge b4bz/homer:latest \ No newline at end of file diff --git a/hooks/pre_build b/hooks/pre_build new file mode 100644 index 0000000..bc1b6fe --- /dev/null +++ b/hooks/pre_build @@ -0,0 +1,8 @@ +#!/bin/bash + +# Update to docker-ee 18.x for manifests +apt-get -y update +apt-get -y --only-upgrade install docker-ee +# Register qemu-*-static for all supported processors except the +# current one, but also remove all registered binfmt_misc before +docker run --rm --privileged multiarch/qemu-user-static:register --reset \ No newline at end of file -- 2.41.0