diff options
author | Aaron Simmons <paleozogt@gmail.com> | 2020-02-17 14:27:24 -0800 |
---|---|---|
committer | Alexys Jacob <ultrabug@gentoo.org> | 2020-02-23 20:46:35 +0100 |
commit | 6219ee847cf38d60753bde2bbe91b0130279c840 (patch) | |
tree | d5a041f14f35f98db87c39e83196921b2d21c9c4 | |
parent | #75: support for building more gentoo arches (diff) | |
download | docker-images-6219ee847cf38d60753bde2bbe91b0130279c840.tar.gz docker-images-6219ee847cf38d60753bde2bbe91b0130279c840.tar.bz2 docker-images-6219ee847cf38d60753bde2bbe91b0130279c840.zip |
using docker-copyedit to modify the arch
Signed-off-by: Alexys Jacob <ultrabug@gentoo.org>
-rw-r--r-- | .gitmodules | 3 | ||||
-rwxr-xr-x | build-multiarch.sh | 9 | ||||
-rwxr-xr-x | build.sh | 5 | ||||
m--------- | docker-copyedit | 0 |
4 files changed, 17 insertions, 0 deletions
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 @@ -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 +Subproject ab6bd5d9f5ca3a9ba314e7124c2aac8ad7987a3 |