From c6b7c1aa6a1b35a1f958d832eead595e7c7ae81e Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Mon, 2 May 2022 01:50:13 +0000 Subject: [PATCH] chore: fix windows pipeline --- cmd/smbplugin/Dockerfile.Windows | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cmd/smbplugin/Dockerfile.Windows b/cmd/smbplugin/Dockerfile.Windows index bffa69bf5a5..5c2e3d76d84 100644 --- a/cmd/smbplugin/Dockerfile.Windows +++ b/cmd/smbplugin/Dockerfile.Windows @@ -1,13 +1,29 @@ -ARG OSVERSION -ARG ARCH=amd64 -FROM --platform=linux/${ARCH} gcr.io/k8s-staging-e2e-test-images/windows-servercore-cache:1.0-linux-${ARCH}-${OSVERSION} as core +# Copyright 2022 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -FROM mcr.microsoft.com/windows/nanoserver:${OSVERSION} +# these arguments come from BUILD_PLATFORMS used in release-tools +ARG ADDON_IMAGE=servercore:1809 +ARG BASE_IMAGE=nanoserver:1809 +ARG REGISTRY=mcr.microsoft.com/windows + +FROM ${REGISTRY}/${ADDON_IMAGE} as addon +FROM ${REGISTRY}/${BASE_IMAGE} LABEL description="CSI SMB plugin" -ARG ARCH=amd64 ARG binary=./_output/${ARCH}/smbplugin.exe COPY ${binary} /smbplugin.exe -COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll +COPY --from=addon /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll + USER ContainerAdministrator ENTRYPOINT ["/smbplugin.exe"]