Browse code

Windows: Bump busybox to v1.1

Signed-off-by: John Howard <jhoward@microsoft.com>

This is a follow-on from https://github.com/moby/moby/pull/38277
but had to be done in a couple of stages to ensure that CI didn't
break. v1.1 of the busybox image is now based on a CMD of "sh"
rather than using an entrypoint. And it also uses the bin directory
rather than `c:\busybox`. This makes it look a lot closer to the
Linux busybox image, and means that a couple of Windows-isms in
CI tests can be reverted back to be identical to their Linux
equivalents.

John Howard authored on 2018/11/27 02:13:12
Showing 2 changed files
... ...
@@ -776,9 +776,9 @@ Try {
776 776
                 # This is a temporary hack for nanoserver
777 777
                 if ($env:WINDOWS_BASE_IMAGE -ne "microsoft/windowsservercore") {
778 778
                     Write-Host -ForegroundColor Red "HACK HACK HACK - Building 64-bit nanoserver busybox image"
779
-                    $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox64/v1.0/Dockerfile | Out-Host)
779
+                    $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox64/v1.1/Dockerfile | Out-Host)
780 780
                 } else {
781
-                    $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/v1.0/Dockerfile | Out-Host)
781
+                    $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/v1.1/Dockerfile | Out-Host)
782 782
                 }
783 783
                 $ErrorActionPreference = "Stop"
784 784
                 if (-not($LastExitCode -eq 0)) {
... ...
@@ -3332,9 +3332,6 @@ func (s *DockerSuite) TestBuildVerifySingleQuoteFails(c *check.C) {
3332 3332
 	// it should barf on it.
3333 3333
 	name := "testbuildsinglequotefails"
3334 3334
 	expectedExitCode := 2
3335
-	if testEnv.OSType == "windows" {
3336
-		expectedExitCode = 127
3337
-	}
3338 3335
 
3339 3336
 	buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox
3340 3337
 		CMD [ '/bin/sh', '-c', 'echo hi' ]`))
... ...
@@ -6058,13 +6055,7 @@ FROM busybox
6058 6058
 WORKDIR /foo/bar
6059 6059
 `))
6060 6060
 	out, _ := dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image)
6061
-
6062
-	// The Windows busybox image has a blank `cmd`
6063
-	lookingFor := `["sh"]`
6064
-	if testEnv.OSType == "windows" {
6065
-		lookingFor = "null"
6066
-	}
6067
-	c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor)
6061
+	c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`)
6068 6062
 
6069 6063
 	image = "testworkdirlabelimagecmd"
6070 6064
 	buildImageSuccessfully(c, image, build.WithDockerfile(`
... ...
@@ -6074,7 +6065,7 @@ LABEL a=b
6074 6074
 `))
6075 6075
 
6076 6076
 	out, _ = dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image)
6077
-	c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor)
6077
+	c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`)
6078 6078
 }
6079 6079
 
6080 6080
 // Test case for 28902/28909