diff --git a/hack/make/.ensure-frozen-images b/hack/make/.ensure-frozen-images index 6e0036c986..52a1aceb1c 100644 --- a/hack/make/.ensure-frozen-images +++ b/hack/make/.ensure-frozen-images @@ -30,7 +30,7 @@ fi if ! docker inspect "${images[@]}" &> /dev/null; then hardCodedDir='/docker-frozen-images' if [ -d "$hardCodedDir" ]; then - # Do not use a subshell for the following command. Windows CI + # Do not use a subshell for the following command. Windows to Linux CI # runs bash 3.x so will not trap an error in a subshell. # http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells set -x; tar -cC "$hardCodedDir" . | docker load; set +x @@ -55,7 +55,7 @@ if ! docker inspect "${images[@]}" &> /dev/null; then } } ' "${DOCKERFILE:=Dockerfile}" | sh -x - # Do not use a subshell for the following command. Windows CI + # Do not use a subshell for the following command. Windows to Linux CI # runs bash 3.x so will not trap an error in a subshell. # http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells set -x; tar -cC "$dir" . | docker load; set +x diff --git a/hack/make/.ensure-frozen-images-windows b/hack/make/.ensure-frozen-images-windows new file mode 100644 index 0000000000..f55a2e4146 --- /dev/null +++ b/hack/make/.ensure-frozen-images-windows @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +# This scripts sets up the required images for Windows to Windows CI + +# Tag windowsservercore as latest +set +e +! BUILD=$(docker images | grep windowsservercore | grep -v latest | awk '{print $2}') +if [ -z $BUILD ]; then + echo "ERROR: Could not find windowsservercore images" + exit 1 +fi + +! LATESTCOUNT=$(docker images | grep windowsservercore | grep -v $BUILD | wc -l) +if [ $LATESTCOUNT -ne 1 ]; then + set -e + docker tag windowsservercore:$BUILD windowsservercore:latest + echo "INFO: Tagged windowsservercore:$BUILD with latest" +fi + +# Busybox (requires windowsservercore) +if [ -z "$(docker images | grep busybox)" ]; then + echo "INFO: Building busybox" + docker build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile +fi \ No newline at end of file diff --git a/hack/make/.integration-daemon-setup b/hack/make/.integration-daemon-setup index 97324862db..508a9d479e 100644 --- a/hack/make/.integration-daemon-setup +++ b/hack/make/.integration-daemon-setup @@ -2,7 +2,12 @@ set -e bundle .detect-daemon-osarch -bundle .ensure-emptyfs -bundle .ensure-frozen-images -bundle .ensure-httpserver -bundle .ensure-syscall-test +if [ $DOCKER_ENGINE_GOOS != "windows" ]; then + bundle .ensure-emptyfs + bundle .ensure-frozen-images + bundle .ensure-httpserver + bundle .ensure-syscall-test +else + # Note this is Windows to Windows CI, not Windows to Linux CI + bundle .ensure-frozen-images-windows +fi