k8s.io/kubernetes@v1.29.3/test/images/agnhost/Dockerfile_windows (about) 1 # Copyright 2020 The Kubernetes Authors. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 ARG BASEIMAGE 16 ARG REGISTRY 17 ARG OS_VERSION 18 19 # We're using a Linux image to unpack the archives, then we're copying them over to Windows. 20 FROM --platform=linux/amd64 alpine:3.6 as prep 21 22 ADD https://github.com/coredns/coredns/releases/download/v1.5.0/coredns_1.5.0_windows_amd64.tgz /coredns.tgz 23 ADD https://iperf.fr/download/windows/iperf-2.0.9-win64.zip /iperf.zip 24 ADD https://download.savannah.nongnu.org/releases/coreutils/windows-64bit-unsupported/coreutils-8.31-28-windows-64bit.zip /coreutils.zip 25 26 # we're also creating an empty /uploads folder, which we're copying over to Windows because 27 # we can't RUN commands on a Windows image. 28 RUN tar -xzvf /coredns.tgz &&\ 29 unzip iperf.zip &&\ 30 mv iperf-2.0.9-win64 iperf &&\ 31 unzip coreutils.zip &&\ 32 mv coreutils-8.31-28-windows-64bit wincoreutils &&\ 33 mkdir /uploads 34 35 FROM --platform=linux/amd64 $REGISTRY/windows-servercore-cache:1.0-linux-amd64-$OS_VERSION as servercore-helper 36 FROM $BASEIMAGE 37 38 # from dnsutils image 39 # install necessary packages: 40 # - bind-tools: contains dig, which can used in DNS tests. 41 # - CoreDNS: used in some DNS tests. 42 # from hostexec image 43 # installed necessary packages: 44 # - curl, nc: used by a lot of e2e tests (inherited from BASEIMAGE) 45 # from iperf image 46 # install necessary packages: iperf 47 COPY --from=servercore-helper /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll 48 COPY --from=prep /coredns.exe /coredns.exe 49 COPY --from=prep /iperf /iperf 50 COPY --from=prep /wincoreutils/sync.exe /bin/sync.exe 51 52 # NOTE(claudiub): docker buildx sets the PATH env variable to a Linux-like PATH, which is not desirable. 53 ENV PATH="C:\dig\;C:\bin\;C:\curl\;C:\Windows\system32;C:\Windows;C:\Program Files\PowerShell;" 54 55 # PORT 80 needed by: test-webserver 56 # PORT 8080 needed by: netexec, nettest 57 # PORT 8081 needed by: netexec 58 # PORT 9376 needed by: serve-hostname 59 EXPOSE 80 8080 8081 9376 60 61 # from netexec 62 COPY --from=prep /uploads /uploads 63 64 # from porter 65 ADD porter/localhost.crt localhost.crt 66 ADD porter/localhost.key localhost.key 67 68 # from mounttest 69 ADD mounttest/filePermissions.ps1 filePermissions.ps1 70 71 ADD agnhost /agnhost 72 73 # needed for the entrypoint-tester related tests. Some of the entrypoint-tester related tests 74 # overrides this image's entrypoint with agnhost-2 binary, and will verify that the correct 75 # entrypoint is used by the containers. 76 ADD agnhost /agnhost-2 77 78 ENTRYPOINT ["/agnhost"] 79 CMD ["pause"]