File tree 5 files changed +25
-4
lines changed
5 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 14
14
15
15
ARG GO_VERSION
16
16
ARG OVS_VERSION
17
+ ARG DOCKER_REGISTRY="docker.io"
17
18
18
19
FROM --platform=linux/amd64 golang:${GO_VERSION} AS antrea-build-windows
19
20
ARG CNI_BINARIES_VERSION
@@ -43,7 +44,7 @@ RUN mkdir -p /go/k/antrea/bin && \
43
44
cp /antrea/bin/antrea-cni.exe /go/k/antrea/cni/antrea.exe && \
44
45
cp /antrea/hack/windows/Install-OVS.ps1 /go/k/antrea/
45
46
46
- FROM antrea/windows-ovs:${OVS_VERSION} AS antrea-ovs
47
+ FROM ${DOCKER_REGISTRY}/ antrea/windows-ovs:${OVS_VERSION} AS antrea-ovs
47
48
48
49
FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
49
50
COPY --from=antrea-build-windows /go/k /k
Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ registry="antrea"
73
73
image_name=" antrea-windows"
74
74
image=" ${registry} /${image_name} "
75
75
BUILD_ARGS=" --build-arg GO_VERSION=${GO_VERSION} --build-arg OVS_VERSION=${OVS_VERSION} --build-arg CNI_BINARIES_VERSION=${CNI_BINARIES_VERSION} "
76
+ if [[ ${DOCKER_REGISTRY} != " " ]]; then
77
+ BUILD_ARGS+=" --build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} "
78
+ fi
76
79
77
80
ANTREA_DIR=${THIS_DIR} /../../
78
81
pushd $ANTREA_DIR > /dev/null
Original file line number Diff line number Diff line change @@ -132,7 +132,12 @@ if $PULL; then
132
132
docker pull $PLATFORM_ARG quay.io/centos/centos:stream9
133
133
docker pull $PLATFORM_ARG registry.access.redhat.com/ubi9
134
134
elif [ " $DISTRO " == " windows" ]; then
135
- docker pull --platform linux/amd64 ubuntu:24.04
135
+ if [[ ${DOCKER_REGISTRY} == " " ]]; then
136
+ docker pull --platform linux/amd64 ubuntu:24.04
137
+ else
138
+ docker pull --platform linux/amd64 ${DOCKER_REGISTRY} /antrea/ubuntu:24.04
139
+ docker tag ${DOCKER_REGISTRY} /antrea/ubuntu:24.04 ubuntu:24.04
140
+ fi
136
141
fi
137
142
fi
138
143
@@ -163,6 +168,9 @@ elif [ "$DISTRO" == "ubi" ]; then
163
168
elif [ " $DISTRO " == " windows" ]; then
164
169
image=" antrea/windows-ovs"
165
170
build_args=" --build-arg OVS_VERSION=$OVS_VERSION "
171
+ if [[ ${DOCKER_REGISTRY} != " " ]]; then
172
+ image=" ${DOCKER_REGISTRY} /antrea/windows-ovs"
173
+ fi
166
174
docker_build_and_push_windows " ${image} " " Dockerfile.windows" " ${build_args} " " ${OVS_VERSION} " $PUSH " "
167
175
fi
168
176
Original file line number Diff line number Diff line change @@ -476,7 +476,7 @@ function deliver_antrea_linux {
476
476
function deliver_antrea_windows {
477
477
echo " ===== Build Antrea Windows ====="
478
478
rm -f antrea-windows.tar.gz
479
- make build-windows
479
+ DOCKER_REGISTRY= " ${DOCKER_REGISTRY} " ./hack/ build-antrea- windows-all.sh --pull
480
480
if ! (test -f antrea-windows.tar); then
481
481
echo " antrea-windows.tar wasn't built, exiting"
482
482
exit 1
@@ -489,7 +489,7 @@ function deliver_antrea_windows {
489
489
revert_snapshot_windows ${WORKER_NAME}
490
490
k8s_images=(" registry.k8s.io/e2e-test-images/agnhost:2.52" " registry.k8s.io/e2e-test-images/jessie-dnsutils:1.5" " registry.k8s.io/e2e-test-images/nginx:1.14-2" " registry.k8s.io/pause:3.10" )
491
491
conformance_images=(" k8sprow.azurecr.io/kubernetes-e2e-test-images/agnhost:2.52" " k8sprow.azurecr.io/kubernetes-e2e-test-images/jessie-dnsutils:1.5" " k8sprow.azurecr.io/kubernetes-e2e-test-images/nginx:1.14-2" " registry.k8s.io/e2e-test-images/pause:3.10" )
492
- e2e_images=(" ${DOCKER_REGISTRY} /antrea/toolbox:1.4-0 " " registry.k8s.io/e2e-test-images/agnhost:2.40" )
492
+ e2e_images=(" ${DOCKER_REGISTRY} /antrea/toolbox:1.5-1 " " registry.k8s.io/e2e-test-images/agnhost:2.40" )
493
493
# Pull necessary images in advance to avoid transient error
494
494
for i in " ${! k8s_images[@]} " ; do
495
495
ssh -o StrictHostKeyChecking=no -n Administrator@${IP} " ctr -n k8s.io images pull --user ${DOCKER_USERNAME} :${DOCKER_PASSWORD} ${k8s_images[i]} && ctr -n k8s.io images tag ${k8s_images[i]} ${conformance_images[i]} " || true
Original file line number Diff line number Diff line change @@ -86,6 +86,15 @@ cd build/images/ovs
86
86
./build.sh --distro windows $ARGS
87
87
cd -
88
88
89
+ GO_VERSION=$( head -n 1 build/images/deps/go-version)
90
+
91
+ if [[ " ${DOCKER_REGISTRY} " == " " ]]; then
92
+ docker pull --platform linux/amd64 golang:$GO_VERSION
93
+ else
94
+ docker pull --platform linux/amd64 ${DOCKER_REGISTRY} /antrea/golang:$GO_VERSION
95
+ docker tag ${DOCKER_REGISTRY} /antrea/golang:$GO_VERSION $GO_VERSION
96
+ fi
97
+
89
98
if $PUSH_AGENT ; then
90
99
make build-and-push-windows
91
100
else
You can’t perform that action at this time.
0 commit comments