Browse code

cleanup jess/unshare image

Signed-off-by: Jessica Frazelle <acidburn@docker.com>

Jessica Frazelle authored on 2015/12/31 02:49:10
Showing 4 changed files
... ...
@@ -198,8 +198,7 @@ COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contri
198 198
 RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
199 199
 	busybox:latest@sha256:eb3c0d4680f9213ee5f348ea6d39489a1f85a318a2ae09e012c426f78252a6d2 \
200 200
 	debian:jessie@sha256:24a900d1671b269d6640b4224e7b63801880d8e3cb2bcbfaa10a5dddcf4469ed \
201
-	hello-world:latest@sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7 \
202
-	jess/unshare:latest@sha256:2e3a8c0591c4690b82d4eba7e5ef8f49f2ddfe9f867f3e865198db9bd1436c5b
201
+	hello-world:latest@sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
203 202
 # see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
204 203
 
205 204
 # Download man page generator
... ...
@@ -29,7 +29,6 @@ case "$DOCKER_ENGINE_OSARCH" in
29 29
 			busybox:latest
30 30
 			debian:jessie
31 31
 			hello-world:latest
32
-			jess/unshare:latest
33 32
 		)
34 33
 		;;
35 34
 esac
... ...
@@ -2858,26 +2858,28 @@ func (s *DockerSuite) TestRunUnshareProc(c *check.C) {
2858 2858
 	testRequires(c, Apparmor, DaemonIsLinux, NotUserNamespace)
2859 2859
 
2860 2860
 	name := "acidburn"
2861
-	out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp:unconfined", "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount")
2861
+	out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp:unconfined", "debian:jessie", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount")
2862 2862
 	if err == nil ||
2863 2863
 		!(strings.Contains(strings.ToLower(out), "permission denied") ||
2864 2864
 			strings.Contains(strings.ToLower(out), "operation not permitted")) {
2865
-		c.Fatalf("unshare with --mount-proc should have failed with permission denied, got: %s, %v", out, err)
2865
+		c.Fatalf("unshare with --mount-proc should have failed with 'permission denied' or 'operation not permitted', got: %s, %v", out, err)
2866 2866
 	}
2867 2867
 
2868 2868
 	name = "cereal"
2869
-	out, _, err = dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp:unconfined", "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc")
2869
+	out, _, err = dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp:unconfined", "debian:jessie", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc")
2870 2870
 	if err == nil ||
2871
-		!(strings.Contains(strings.ToLower(out), "permission denied") ||
2872
-			strings.Contains(strings.ToLower(out), "operation not permitted")) {
2873
-		c.Fatalf("unshare and mount of /proc should have failed with permission denied, got: %s, %v", out, err)
2871
+		!(strings.Contains(strings.ToLower(out), "mount: cannot mount none") ||
2872
+			strings.Contains(strings.ToLower(out), "permission denied")) {
2873
+		c.Fatalf("unshare and mount of /proc should have failed with 'mount: cannot mount none' or 'permission denied', got: %s, %v", out, err)
2874 2874
 	}
2875 2875
 
2876 2876
 	/* Ensure still fails if running privileged with the default policy */
2877 2877
 	name = "crashoverride"
2878
-	out, _, err = dockerCmdWithError("run", "--privileged", "--security-opt", "seccomp:unconfined", "--security-opt", "apparmor:docker-default", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc")
2879
-	if err == nil || !(strings.Contains(strings.ToLower(out), "permission denied") || strings.Contains(strings.ToLower(out), "operation not permitted")) {
2880
-		c.Fatalf("privileged unshare with apparmor should have failed with permission denied, got: %s, %v", out, err)
2878
+	out, _, err = dockerCmdWithError("run", "--privileged", "--security-opt", "seccomp:unconfined", "--security-opt", "apparmor:docker-default", "--name", name, "debian:jessie", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc")
2879
+	if err == nil ||
2880
+		!(strings.Contains(strings.ToLower(out), "mount: cannot mount none") ||
2881
+			strings.Contains(strings.ToLower(out), "permission denied")) {
2882
+		c.Fatalf("privileged unshare with apparmor should have failed with 'mount: cannot mount none' or 'permission denied', got: %s, %v", out, err)
2881 2883
 	}
2882 2884
 }
2883 2885
 
... ...
@@ -493,7 +493,7 @@ func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) {
493 493
 	}
494 494
 }
495 495
 
496
-// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp:/tmp/profile.json jess/unshare unshare' exits with operation not permitted.
496
+// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp:/tmp/profile.json debian:jessie unshare' exits with operation not permitted.
497 497
 func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *check.C) {
498 498
 	testRequires(c, SameHostDaemon, seccompEnabled)
499 499
 	jsonData := `{
... ...
@@ -549,7 +549,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *check.C) {
549 549
 	}
550 550
 }
551 551
 
552
-// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run jess/unshare unshare --map-root-user --user sh -c whoami' with a specific profile to
552
+// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:jessie unshare --map-root-user --user sh -c whoami' with a specific profile to
553 553
 // deny unhare of a userns exits with operation not permitted.
554 554
 func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *check.C) {
555 555
 	testRequires(c, SameHostDaemon, seccompEnabled)