Browse code

Fixes for ppc64le and 390x frozen-images

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

Christopher Jones authored on 2015/12/04 07:44:28
Showing 5 changed files
... ...
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
17 17
 	curl \
18 18
 	git \
19 19
 	iptables \
20
+	jq \
20 21
 	net-tools \
21 22
 	libapparmor-dev \
22 23
 	libcap-dev \
... ...
@@ -77,8 +78,8 @@ WORKDIR /go/src/github.com/docker/docker
77 77
 ENV DOCKER_BUILDTAGS apparmor selinux
78 78
 
79 79
 ENV IMAGEREPO ppc64le
80
-COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/
81
-RUN ./contrib/download-frozen-image.sh /docker-frozen-images \
80
+COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
81
+RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
82 82
 	$IMAGEREPO/busybox:latest \
83 83
 	$IMAGEREPO/hello-world:frozen 
84 84
 
... ...
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
17 17
 	curl \
18 18
 	git \
19 19
 	iptables \
20
+	jq \
20 21
 	net-tools \
21 22
 	libapparmor-dev \
22 23
 	libcap-dev \
... ...
@@ -76,8 +77,8 @@ WORKDIR /go/src/github.com/docker/docker
76 76
 ENV DOCKER_BUILDTAGS apparmor selinux
77 77
 
78 78
 ENV IMAGEREPO s390x
79
-COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/
80
-RUN ./contrib/download-frozen-image.sh /docker-frozen-images \
79
+COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
80
+RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
81 81
 	$IMAGEREPO/busybox:latest \
82 82
 	$IMAGEREPO/hello-world:frozen 
83 83
 
... ...
@@ -1,21 +1,37 @@
1 1
 #!/bin/bash
2 2
 set -e
3 3
 
4
-# this list should match roughly what's in the Dockerfile (minus the explicit image IDs, of course)
5
-images=(
6
-	busybox:latest
7
-	hello-world:latest
8
-	jess/unshare:latest
9
-)
10
-
11
-# on ARM we need images that work for the ARM architecture
12
-if [ "$DOCKER_ENGINE_OSARCH" = "linux/arm" ]; then
13
-	images=(
14
-		hypriot/armhf-busybox@ea0800bb83571c585c5652b53668e76b29c7c0eef719892f9d0a48607984f9e1
15
-		hypriot/armhf-hello-world@508c59a4f8b23c77bbcf43296c3f580873dc7eecb1f0d680cea3067e221fd4c2
16
-		hypriot/armhf-unshare@3f1db65f8bbabc743fd739cf7145a56c35b2a0979ae3174e9d79b7fa4b00fca1
17
-	)
18
-fi
4
+# image lists for different archs that should match what's in the Dockerfile (minus the explicit images IDs)
5
+case "$DOCKER_ENGINE_OSARCH" in
6
+	linux/arm) 
7
+		images=(
8
+                	hypriot/armhf-busybox@ea0800bb83571c585c5652b53668e76b29c7c0eef719892f9d0a48607984f9e1
9
+			hypriot/armhf-hello-world@508c59a4f8b23c77bbcf43296c3f580873dc7eecb1f0d680cea3067e221fd4c2
10
+                	hypriot/armhf-unshare@3f1db65f8bbabc743fd739cf7145a56c35b2a0979ae3174e9d79b7fa4b00fca1
11
+        	)
12
+		;;
13
+	linux/ppc64le)
14
+		images=(
15
+                	ppc64le/busybox:latest
16
+                	ppc64le/hello-world:frozen
17
+                	ppc64le/unshare:latest
18
+        	)
19
+		;;
20
+	linux/s390x)
21
+		images=(
22
+			s390x/busybox:latest
23
+			s390x/hello-world:frozen
24
+			s390x/unshare:latest	
25
+		)
26
+		;;
27
+	*)
28
+		images=(
29
+                	busybox:latest
30
+                	hello-world:latest
31
+                	jess/unshare:latest
32
+        	)
33
+		;;
34
+esac
19 35
 
20 36
 if ! docker inspect "${images[@]}" &> /dev/null; then
21 37
 	hardCodedDir='/docker-frozen-images'
... ...
@@ -46,16 +62,34 @@ if ! docker inspect "${images[@]}" &> /dev/null; then
46 46
 	fi
47 47
 fi
48 48
 
49
-if [ "$DOCKER_ENGINE_OSARCH" = "linux/arm" ]; then
50
-	# tag images to ensure that all integrations work with the defined image names
51
-	docker tag hypriot/armhf-busybox:latest busybox:latest
52
-	docker tag hypriot/armhf-hello-world:latest hello-world:frozen
53
-	docker tag hypriot/armhf-unshare:latest jess/unshare:latest
54
-
55
-	# remove orignal tags as these make problems with later tests: TestInspectApiImageResponse
56
-	docker rmi hypriot/armhf-busybox:latest
57
-	docker rmi hypriot/armhf-hello-world:latest
58
-	docker rmi hypriot/armhf-unshare:latest
59
-else
60
-	docker tag hello-world:latest hello-world:frozen
61
-fi
49
+# tag images to ensure that all integrations work with the defined image names
50
+# then remove original tags as these make problems with later tests (e.g., TestInspectApiImageResponse)
51
+case "$DOCKER_ENGINE_OSARCH" in
52
+	linux/arm)
53
+		docker tag hypriot/armhf-busybox:latest busybox:latest
54
+        	docker tag hypriot/armhf-hello-world:latest hello-world:frozen
55
+        	docker tag hypriot/armhf-unshare:latest jess/unshare:latest		
56
+		docker rmi hypriot/armhf-busybox:latest
57
+        	docker rmi hypriot/armhf-hello-world:latest
58
+        	docker rmi hypriot/armhf-unshare:latest
59
+		;;
60
+	linux/ppc64le)
61
+		docker tag ppc64le/busybox:latest busybox:latest
62
+        	docker tag ppc64le/hello-world:frozen hello-world:frozen
63
+		docker tag ppc64le/unshare:latest jess/unshare:latest
64
+		docker rmi ppc64le/busybox:latest
65
+        	docker rmi ppc64le/hello-world:frozen
66
+		docker rmi ppc64le/unshare:latest		
67
+		;;
68
+	linux/s390x)
69
+		docker tag s390x/busybox:latest busybox:latest
70
+		docker tag s390x/hello-world:frozen hello-world:frozen
71
+		docker tag s390x/unshare:latest jess/unshare:latest
72
+		docker rmi s390x/busybox:latest
73
+		docker rmi s390x/hello-world:frozen
74
+		docker rmi s390x/unshare:latest
75
+		;;
76
+	*)
77
+		docker tag hello-world:latest hello-world:frozen
78
+		;;
79
+esac
62 80
deleted file mode 100644
... ...
@@ -1,9 +0,0 @@
1
-for image in `docker images | awk '{print $1}'`; do
2
-if ( [ -z "${image##$IMAGEREPO/busybox}" ] ); then
3
-	docker tag $image busybox:latest
4
-	docker rmi $image
5
-elif ( [ -z "${image##$IMAGEREPO/hello-world}" ] ); then
6
-	docker tag $image:frozen hello-world:frozen
7
-	docker rmi $image:frozen
8
-fi
9
-done
... ...
@@ -2,5 +2,4 @@
2 2
 
3 3
 bundle .ensure-emptyfs
4 4
 bundle .ensure-frozen-images
5
-bundle .ensure-images
6 5
 bundle .ensure-httpserver