Skip to content

Commit 97b7426

Browse files
committed
hack/ci/windows.ps1: build busybox from local Dockerfile
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 8164f29 commit 97b7426

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

contrib/busybox/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
# Source: http://frippery.org/busybox/
1+
# Source: https://frippery.org/busybox/
22
# This Dockerfile builds a (32-bit) busybox images which is suitable for
33
# running many of the integration-cli tests for Docker against a Windows
44
# daemon. It will not run on nanoserver as that is 64-bit only.
55
#
6+
# Based on https://github.com/jhowardmsft/busybox
67
# John Howard (IRC jhowardmsft, Email [email protected])
78
#
89
# To build: docker build -t busybox .
910
# To publish: Needs someone with publishing rights
10-
#
11-
# http://github.com/jhowardmsft/busybox
11+
ARG WINDOWS_BASE_IMAGE=mcr.microsoft.com/windows/servercore
12+
ARG WINDOWS_BASE_IMAGE_TAG=ltsc2019
1213

13-
FROM microsoft/windowsservercore
14+
FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
1415
RUN mkdir C:\tmp && mkdir C:\bin
1516
ADD http://frippery.org/files/busybox/busybox.exe /bin/
1617
RUN setx /M PATH "C:\bin;%PATH%"
1718
RUN powershell busybox.exe --list ^|%{$nul = cmd /c mklink C:\bin\$_.exe busybox.exe}
18-
CMD ["sh"]
19+
CMD ["sh"]

hack/ci/windows.ps1

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Function Nuke-Everything {
161161
}
162162

163163
$allImages = $(docker images --format "{{.Repository}}#{{.ID}}")
164-
$toRemove = ($allImages | Select-String -NotMatch "servercore","nanoserver","docker")
164+
$toRemove = ($allImages | Select-String -NotMatch "servercore","nanoserver","docker","busybox")
165165
$imageCount = ($toRemove | Measure-Object -line).Lines
166166

167167
if ($imageCount -gt 0) {
@@ -827,23 +827,13 @@ Try {
827827
# Add the Windows busybox image. Needed for WCOW integration tests
828828
if (($null -eq $env:LCOW_MODE) -and ($null -eq $env:LCOW_BASIC_MODE)) {
829829
if ($null -eq $env:SKIP_INTEGRATION_TESTS) {
830+
Write-Host -ForegroundColor Green "INFO: Building busybox"
830831
$ErrorActionPreference = "SilentlyContinue"
831-
# Build it regardless while switching between nanoserver and windowsservercore
832-
#$bbCount = $(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" images | Select-String "busybox" | Measure-Object -line).Lines
833-
#$ErrorActionPreference = "Stop"
834-
#if (-not($LastExitCode -eq 0)) {
835-
# Throw "ERROR: Could not determine if busybox image is present"
836-
#}
837-
#if ($bbCount -eq 0) {
838-
Write-Host -ForegroundColor Green "INFO: Building busybox"
839-
$ErrorActionPreference = "SilentlyContinue"
840-
$(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox https://raw.githubusercontent.com/moby/busybox/v1.1/Dockerfile | Out-Host)
841-
$ErrorActionPreference = "Stop"
842-
if (-not($LastExitCode -eq 0)) {
843-
Throw "ERROR: Failed to build busybox image"
844-
}
845-
#}
846-
832+
$(& "$env:TEMP\binary\docker-$COMMITHASH" "-H=$($DASHH_CUT)" build -t busybox --build-arg WINDOWS_BASE_IMAGE --build-arg WINDOWS_BASE_IMAGE_TAG "$env:SOURCES_DRIVE`:\$env:SOURCES_SUBDIR\src\github.com\docker\docker\contrib\busybox\" | Out-Host)
833+
$ErrorActionPreference = "Stop"
834+
if (-not($LastExitCode -eq 0)) {
835+
Throw "ERROR: Failed to build busybox image"
836+
}
847837

848838
Write-Host -ForegroundColor Green "INFO: Docker images of the daemon under test"
849839
Write-Host

0 commit comments

Comments
 (0)