diff --git a/Dockerfile.windows b/Dockerfile.windows index 43421ab58a..e8730541ee 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -104,20 +104,10 @@ RUN mv CalicoWindows/cni/calico.exe rancher/ RUN mv CalicoWindows/cni/calico-ipam.exe rancher/ RUN mv CalicoWindows/confd confd/ -FROM mcr.microsoft.com/windows/nanoserver:1809 AS windows-runtime +FROM scratch AS windows-runtime LABEL org.opencontainers.image.url="https://hub.docker.com/r/rancher/rke2-runtime" LABEL org.opencontainers.image.source="https://github.com/rancher/rke2" - -USER ContainerAdministrator -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -# Create necessary directories -RUN New-Item -ItemType Directory -Force -Path C:\bin, C:\bin\confd, C:\charts - -# Copy files using Windows paths -COPY --from=containerd /usr/local/bin/*.exe C:/bin/ -COPY --from=windows-runtime-collect ./rancher/* C:/bin/ -COPY --from=windows-runtime-collect ./confd/ C:/bin/confd/ -COPY --from=windows-runtime-collect ./charts C:/charts/ - -USER ContainerUser +COPY --from=containerd /usr/local/bin/*.exe /bin/ +COPY --from=windows-runtime-collect ./rancher/* /bin/ +COPY --from=windows-runtime-collect ./confd/ /bin/confd +COPY --from=windows-runtime-collect ./charts /charts/