From b66629b951d546f9bb12564424b7506f11726bd7 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 3 May 2020 11:12:29 -0500 Subject: [PATCH] Added helper script for building multiarch image --- build-multiarch.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 build-multiarch.sh diff --git a/build-multiarch.sh b/build-multiarch.sh new file mode 100644 index 00000000..4694c66e --- /dev/null +++ b/build-multiarch.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# manually purge any pre-existing manifest list +# since docker manifest command lacks a "remove" operation +rm -rf ~/.docker/manifests/docker.io_itzg_minecraft-server-multiarch + +export DOCKER_BUILDKIT=1 + +docker build --platform linux/arm64 -t itzg/minecraft-server:arm64 . +docker push itzg/minecraft-server:arm64 + +armv7tag=armv7-buildkit +armv7workDir=/tmp/armv7-$$ +git worktree add $armv7workDir armv7 +# sub-shell for build of armv7 +( + cd $armv7workDir + docker build --platform linux/arm/v7 -t itzg/minecraft-server:$armv7tag . + docker push itzg/minecraft-server:$armv7tag +) +git worktree remove $armv7workDir + +docker pull itzg/minecraft-server +# use the rpi build one for now since armv7-buildkit is giving ABI mismatch on curl +docker pull itzg/minecraft-server:armv7 + +docker manifest create itzg/minecraft-server:multiarch \ + itzg/minecraft-server \ + itzg/minecraft-server:armv7 \ + itzg/minecraft-server:arm64 + +docker manifest inspect itzg/minecraft-server:multiarch + +docker manifest push -p itzg/minecraft-server:multiarch