Gentoo Archives: gentoo-commits

From: Alexys Jacob <ultrabug@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/docker-images:master commit in: /
Date: Sun, 23 Feb 2020 19:46:51
Message-Id: 1582487195.6219ee847cf38d60753bde2bbe91b0130279c840.ultrabug@gentoo
1 commit: 6219ee847cf38d60753bde2bbe91b0130279c840
2 Author: Aaron Simmons <paleozogt <AT> gmail <DOT> com>
3 AuthorDate: Mon Feb 17 22:27:24 2020 +0000
4 Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 23 19:46:35 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=6219ee84
7
8 using docker-copyedit to modify the arch
9
10 Signed-off-by: Alexys Jacob <ultrabug <AT> gentoo.org>
11
12 .gitmodules | 3 +++
13 build-multiarch.sh | 9 +++++++++
14 build.sh | 5 +++++
15 docker-copyedit | 1 +
16 4 files changed, 18 insertions(+)
17
18 diff --git a/.gitmodules b/.gitmodules
19 new file mode 100644
20 index 0000000..52c678d
21 --- /dev/null
22 +++ b/.gitmodules
23 @@ -0,0 +1,3 @@
24 +[submodule "docker-copyedit"]
25 + path = docker-copyedit
26 + url = https://github.com/gdraheim/docker-copyedit.git
27
28 diff --git a/build-multiarch.sh b/build-multiarch.sh
29 new file mode 100755
30 index 0000000..bc2fde9
31 --- /dev/null
32 +++ b/build-multiarch.sh
33 @@ -0,0 +1,9 @@
34 +#!/bin/bash
35 +docker manifest create gentoo/stage3 \
36 + gentoo/stage3-amd64 \
37 + gentoo/stage3-x86 \
38 + gentoo/stage3-armv7a \
39 + gentoo/stage3-amd64 \
40 + gentoo/stage3-ppc \
41 + gentoo/stage3-ppc64 \
42 + gentoo/stage3-ppc64le
43
44 diff --git a/build.sh b/build.sh
45 index eb38eac..feacd63 100755
46 --- a/build.sh
47 +++ b/build.sh
48 @@ -11,6 +11,7 @@ fi
49
50 # Split the TARGET variable into three elements separated by hyphens
51 IFS=- read -r NAME ARCH SUFFIX <<< "${TARGET}"
52 +DOCKER_ARCH="${ARCH}"
53
54 # Ensure upstream directories for stage3-amd64-hardened+nomultilib work
55 SUFFIX=${SUFFIX/-/+}
56 @@ -21,12 +22,14 @@ ORG=${ORG:-gentoo}
57
58 # x86 requires the i686 subfolder
59 if [[ "${ARCH}" == "x86" ]]; then
60 + DOCKER_ARCH="386"
61 MICROARCH="i686"
62 BOOTSTRAP="multiarch/alpine:x86-v3.7"
63 elif [[ "${ARCH}" = ppc* ]]; then
64 MICROARCH="${ARCH}"
65 ARCH=ppc
66 elif [[ "${ARCH}" = arm* ]]; then
67 + DOCKER_ARCH=$(echo $ARCH | sed -e 's-\(v.\).*-/\1-g')
68 MICROARCH="${ARCH}"
69 ARCH=arm
70 else
71 @@ -40,4 +43,6 @@ fi
72
73 set -x
74 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" .
75 +docker-copyedit/docker-copyedit.py FROM "${ORG}/${TARGET}:${VERSION}" INTO "${ORG}/${TARGET}:${VERSION}" -vv \
76 + set arch ${DOCKER_ARCH}
77 docker tag "${ORG}/${TARGET}:${VERSION}" "${ORG}/${TARGET}:latest"
78
79 diff --git a/docker-copyedit b/docker-copyedit
80 new file mode 160000
81 index 0000000..ab6bd5d
82 --- /dev/null
83 +++ b/docker-copyedit
84 @@ -0,0 +1 @@
85 +Subproject commit ab6bd5d9f5ca3a9ba314e7124c2aac8ad7987a3b