github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/hack/make/.ensure-frozen-images-windows (about) 1 #!/bin/bash 2 set -e 3 4 # This scripts sets up the required images for Windows to Windows CI 5 6 # Tag (microsoft/)windowsservercore as latest 7 set +e 8 ! BUILD=$(docker images | grep windowsservercore | grep -v latest | awk '{print $2}') 9 if [ -z $BUILD ]; then 10 echo "ERROR: Could not find windowsservercore images" 11 exit 1 12 fi 13 14 # Get the name. Around 2016 6D TP5, these have the microsoft/ prefix, hence cater for both. 15 ! IMAGENAME=$(docker images | grep windowsservercore | grep -v latest | awk '{print $1}') 16 if [ -z $IMAGENAME ]; then 17 echo "ERROR: Could not find windowsservercore image" 18 exit 1 19 fi 20 21 ! LATESTCOUNT=$(docker images | grep windowsservercore | grep -v $BUILD | wc -l) 22 if [ $LATESTCOUNT -ne 1 ]; then 23 set -e 24 docker tag $IMAGENAME:$BUILD windowsservercore:latest 25 echo "INFO: Tagged $IMAGENAME:$BUILD as windowsservercore:latest" 26 fi 27 28 # Busybox (requires windowsservercore) 29 if [ -z "$(docker images | grep busybox)" ]; then 30 echo "INFO: Building busybox" 31 docker build -t busybox https://raw.githubusercontent.com/jhowardmsft/busybox/master/Dockerfile 32 fi