@@ -34,23 +34,61 @@ elif [[ "$task" == "pull-image" ]]; then
3434 exit $?
3535 fi
3636
37+ # Tag the arch specific image with the generic tag
3738 cmd=" $DOCKER tag $arch_image $image "
3839 (set -x; $cmd )
40+ if [[ $? -ne 0 ]]; then
41+ echo " Error: tagging $arch_image as $image ?" >&2
42+ exit 1
43+ fi
44+
45+ # Remove the arch tag (not the whole image)
46+ cmd=" $DOCKER rmi $arch_image "
47+ (set -x; $cmd )
48+ if [[ $? -ne 0 ]]; then
49+ echo " Error: untagging $arch_image ?" >&2
50+ exit 1
51+ fi
3952
40- exit $?
53+ exit 0
4154elif [[ " $task " == " push-image" ]]; then
4255 if [[ -n " $DOCKER_PASSWORD " && -n " $DOCKER_USER " ]]; then
4356 cmd=" $DOCKER login -u $DOCKER_USER -p $DOCKER_PASSWORD "
4457 (set -x; $cmd )
4558 fi
4659
47- image=" $image -$( uname -m) "
48- cmd=" $DOCKER push $image "
60+ # Temporarily tag the image with the arch
61+ arch_image=" $image -$( uname -m) "
62+ cmd=" $DOCKER tag $image $arch_image "
63+ (set -x; $cmd )
64+ if [[ $? -ne 0 ]]; then
65+ echo " Error: tagging $image as $arch_image ?" >&2
66+ exit 1
67+ fi
68+
69+ cmd=" $DOCKER push $arch_image "
70+ (set -x; $cmd )
71+ if [[ $? -ne 0 ]]; then
72+ echo " Error: pushing $arch_image ?" >&2
73+ exit 1
74+ fi
75+
76+ # Remove the arch tag (not the whole image)
77+ cmd=" $DOCKER rmi $arch_image "
4978 (set -x; $cmd )
50- exit $?
79+ if [[ $? -ne 0 ]]; then
80+ echo " Error: untagging $arch_image ?" >&2
81+ exit 1
82+ fi
83+
84+ exit 0
5185fi
5286
53- cmd=" $DOCKER build --pull -f $distro /Dockerfile "
87+ cmd=" $DOCKER build -f $distro /Dockerfile "
88+
89+ if [[ " $distro " != " ubuntu-allcross" ]]; then
90+ cmd+=" --pull "
91+ fi
5492
5593if [[ -n " $http_proxy " ]]; then
5694 cmd+=" --build-arg http_proxy=$http_proxy "
@@ -73,7 +111,7 @@ from="${DOCKER_REGISTRY}$distro:$version"
73111if [[ " $distro " == " docs" ]]; then
74112 from=" ${DOCKER_REGISTRY} ubuntu:$version "
75113elif [[ " $distro " == " ubuntu-allcross" ]]; then
76- from=" ${DOCKER_REGISTRY} linuxppc/build:ubuntu-$version - $( uname -m ) "
114+ from=" ${DOCKER_REGISTRY} linuxppc/build:ubuntu-$version "
77115elif [[ " $distro " == " korg" ]]; then
78116 cmd+=" --build-arg compiler_version=$version "
79117
@@ -94,7 +132,6 @@ cmd+="--build-arg uid=$UID "
94132cmd+=" --build-arg gid=$GID "
95133cmd+=" --build-arg from=$from "
96134cmd+=" --build-arg apt_mirror=$APT_MIRROR "
97- cmd+=" -t $image -$( uname -m) "
98135cmd+=" -t $image ."
99136
100137(set -x; $cmd )
0 commit comments