From 9a1f0b638583d3f06eb60fc9bfe3206b66c5acbf Mon Sep 17 00:00:00 2001 From: John Howard Date: Mon, 26 Nov 2018 09:13:12 -0800 Subject: [PATCH] Windows: Bump busybox to v1.1 Signed-off-by: John Howard 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. (cherry picked from commit 561e0f6b7fc256c160292b32695cf1d6150741db) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 613c2f27ed2e7d65474c2f3e786d9e24e757d99d Component: engine --- components/engine/hack/ci/windows.ps1 | 4 ++-- .../engine/integration-cli/docker_cli_build_test.go | 13 ++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/components/engine/hack/ci/windows.ps1 b/components/engine/hack/ci/windows.ps1 index 4755bf362e..b0e64d3ae2 100644 --- a/components/engine/hack/ci/windows.ps1 +++ b/components/engine/hack/ci/windows.ps1 @@ -776,9 +776,9 @@ Try { # This is a temporary hack for nanoserver if ($env:WINDOWS_BASE_IMAGE -ne "microsoft/windowsservercore") { Write-Host -ForegroundColor Red "HACK HACK HACK - Building 64-bit nanoserver busybox image" - $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox64/v1.0/Dockerfile | Out-Host) + $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox64/v1.1/Dockerfile | Out-Host) } else { - $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/v1.0/Dockerfile | Out-Host) + $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/v1.1/Dockerfile | Out-Host) } $ErrorActionPreference = "Stop" if (-not($LastExitCode -eq 0)) { diff --git a/components/engine/integration-cli/docker_cli_build_test.go b/components/engine/integration-cli/docker_cli_build_test.go index f6d5fe23f3..1f9f49132e 100644 --- a/components/engine/integration-cli/docker_cli_build_test.go +++ b/components/engine/integration-cli/docker_cli_build_test.go @@ -3331,9 +3331,6 @@ func (s *DockerSuite) TestBuildVerifySingleQuoteFails(c *check.C) { // it should barf on it. name := "testbuildsinglequotefails" expectedExitCode := 2 - if testEnv.OSType == "windows" { - expectedExitCode = 127 - } buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox CMD [ '/bin/sh', '-c', 'echo hi' ]`)) @@ -6052,13 +6049,7 @@ FROM busybox WORKDIR /foo/bar `)) out, _ := dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image) - - // The Windows busybox image has a blank `cmd` - lookingFor := `["sh"]` - if testEnv.OSType == "windows" { - lookingFor = "null" - } - c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor) + c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`) image = "testworkdirlabelimagecmd" buildImageSuccessfully(c, image, build.WithDockerfile(` @@ -6068,7 +6059,7 @@ LABEL a=b `)) out, _ = dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image) - c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor) + c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`) } // Test case for 28902/28909