17
17
REGISTRY ?= staging-k8s.gcr.io
18
18
IMAGE = $(REGISTRY ) /pause
19
19
20
- TAG ?= 3.7
20
+ TAG ?= 3.8
21
21
REV = $(shell git describe --contains --always --match='v* ')
22
22
23
23
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
@@ -68,7 +68,8 @@ TRIPLE.linux-ppc64le := powerpc64le-linux-gnu
68
68
TRIPLE.linux-s390x := s390x-linux-gnu
69
69
TRIPLE := ${TRIPLE.${OS}-${ARCH}}
70
70
BASE.linux := scratch
71
- BASE.windows := mcr.microsoft.com/windows/nanoserver
71
+ # Source for windows pause image base is located at https://github.com/microsoft/windows-pause-image-base
72
+ BASE.windows := mcr.microsoft.com/oss/kubernetes/windows-pause-image-base:v0.2
72
73
BASE := ${BASE.${OS}}
73
74
74
75
# If you want to build AND push all containers, see the 'all-push' rule.
@@ -77,16 +78,21 @@ all: all-container-docker
77
78
# NOTE(claudiub): A non-default builder instance is needed in order to build Windows images.
78
79
all-push : all-container-registry push-manifest
79
80
81
+ push-manifest : SHELL:=/bin/bash
80
82
push-manifest :
81
83
docker manifest create --amend $(IMAGE ) :$(TAG ) $(shell echo $(ALL_OS_ARCH ) | sed -e "s~[^ ]* ~$(IMAGE ) :$(TAG ) \-&~g")
82
84
set -x; for arch in $( ALL_ARCH.linux) ; do docker manifest annotate --os linux --arch $$ {arch} ${IMAGE} :${TAG} ${IMAGE} :${TAG} -linux-$$ {arch}; done
83
85
# For Windows images, we also need to include the "os.version" in the manifest list, so the Windows node can pull the proper image it needs.
84
86
# we use awk to also trim the quotes around the OS version string.
85
87
set -x; \
88
+ # tagToKernelVersionMap maps the container images tags for different Windows Server releases (ex: ltsc2022 for Windows Server 2022)
89
+ # to the kernel version for that OS release (ex: 20348 for Windows Server 2022). This is needed to fetch the servicing revision from the
90
+ # pause base image manifest (which containers an entry for each Windows Server version) so we can add the approrite 'os.version'
91
+ # field to the pause image manifest.
92
+ declare -A tagToKernelVersionMap=( [' 1809' ]=' 17763' [' 20H2' ]=' 19042' [' ltsc2022' ]=' 20348' ); \
86
93
for arch in $( ALL_ARCH.windows) ; do \
87
94
for osversion in ${ALL_OSVERSIONS.windows} ; do \
88
- BASEIMAGE=${BASE.windows} :$$ {osversion}; \
89
- full_version=` docker manifest inspect ${BASE.windows} :$$ {osversion} | grep " os.version" | head -n 1 | awk -F\" ' {print $$4}' ` || true ; \
95
+ full_version=` docker manifest inspect ${BASE.windows} | grep " 10.0.$$ {tagToKernelVersionMap[$$ osversion]}" | head -n 1 | awk -F\" ' {print $$4}' ` || true ; \
90
96
docker manifest annotate --os windows --arch $$ {arch} --os-version $$ {full_version} ${IMAGE} :${TAG} ${IMAGE} :${TAG} -windows-$$ {arch}-$$ {osversion}; \
91
97
done ; \
92
98
done
@@ -122,7 +128,7 @@ container: .container-${OS}-$(ARCH)
122
128
123
129
.container-windows-$(ARCH ) : $(foreach binary, ${BIN}, bin/${binary}-${OS}-${ARCH})
124
130
docker buildx build --pull --output=type=${OUTPUT_TYPE} --platform ${OS} /$(ARCH ) \
125
- -t $(IMAGE ) :$(TAG ) -${OS} -$(ARCH ) -${OSVERSION} --build-arg BASE=${BASE} : ${OSVERSION} --build-arg ARCH=$(ARCH ) -f Dockerfile_windows .
131
+ -t $(IMAGE ) :$(TAG ) -${OS} -$(ARCH ) -${OSVERSION} --build-arg BASE=${BASE} -windows- ${OSVERSION} - ${ARCH } --build-arg ARCH=$(ARCH ) -f Dockerfile_windows .
126
132
touch $@
127
133
128
134
# Useful for testing, not automatically included in container image
0 commit comments