commit: 6219ee847cf38d60753bde2bbe91b0130279c840 Author: Aaron Simmons <paleozogt <AT> gmail <DOT> com> AuthorDate: Mon Feb 17 22:27:24 2020 +0000 Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org> CommitDate: Sun Feb 23 19:46:35 2020 +0000 URL: https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=6219ee84
using docker-copyedit to modify the arch Signed-off-by: Alexys Jacob <ultrabug <AT> gentoo.org> .gitmodules | 3 +++ build-multiarch.sh | 9 +++++++++ build.sh | 5 +++++ docker-copyedit | 1 + 4 files changed, 18 insertions(+) diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..52c678d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docker-copyedit"] + path = docker-copyedit + url = https://github.com/gdraheim/docker-copyedit.git diff --git a/build-multiarch.sh b/build-multiarch.sh new file mode 100755 index 0000000..bc2fde9 --- /dev/null +++ b/build-multiarch.sh @@ -0,0 +1,9 @@ +#!/bin/bash +docker manifest create gentoo/stage3 \ + gentoo/stage3-amd64 \ + gentoo/stage3-x86 \ + gentoo/stage3-armv7a \ + gentoo/stage3-amd64 \ + gentoo/stage3-ppc \ + gentoo/stage3-ppc64 \ + gentoo/stage3-ppc64le diff --git a/build.sh b/build.sh index eb38eac..feacd63 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,7 @@ fi # Split the TARGET variable into three elements separated by hyphens IFS=- read -r NAME ARCH SUFFIX <<< "${TARGET}" +DOCKER_ARCH="${ARCH}" # Ensure upstream directories for stage3-amd64-hardened+nomultilib work SUFFIX=${SUFFIX/-/+} @@ -21,12 +22,14 @@ ORG=${ORG:-gentoo} # x86 requires the i686 subfolder if [[ "${ARCH}" == "x86" ]]; then + DOCKER_ARCH="386" MICROARCH="i686" BOOTSTRAP="multiarch/alpine:x86-v3.7" elif [[ "${ARCH}" = ppc* ]]; then MICROARCH="${ARCH}" ARCH=ppc elif [[ "${ARCH}" = arm* ]]; then + DOCKER_ARCH=$(echo $ARCH | sed -e 's-\(v.\).*-/\1-g') MICROARCH="${ARCH}" ARCH=arm else @@ -40,4 +43,6 @@ fi set -x docker build --build-arg ARCH="${ARCH}" --build-arg MICROARCH="${MICROARCH}" --build-arg BOOTSTRAP="${BOOTSTRAP}" --build-arg SUFFIX="${SUFFIX}" -t "${ORG}/${TARGET}:${VERSION}" -f "${NAME}.Dockerfile" . +docker-copyedit/docker-copyedit.py FROM "${ORG}/${TARGET}:${VERSION}" INTO "${ORG}/${TARGET}:${VERSION}" -vv \ + set arch ${DOCKER_ARCH} docker tag "${ORG}/${TARGET}:${VERSION}" "${ORG}/${TARGET}:latest" diff --git a/docker-copyedit b/docker-copyedit new file mode 160000 index 0000000..ab6bd5d --- /dev/null +++ b/docker-copyedit @@ -0,0 +1 @@ +Subproject commit ab6bd5d9f5ca3a9ba314e7124c2aac8ad7987a3b
