Skip to content

Commit 63d1573

Browse files
committed
Add netapi32.dll to windows images
This missing dll is required to run may containerized golang apps since anything checking the current user via the os package relies on this. It so happens that klog does this and so its common for some dependency to end up with the issue. We can continue to shift to klog/v2 which may fix the issue, but it would could get hit via another import as well. Fixes #1263 Signed-off-by: John Schnake <[email protected]>
1 parent 4d28adf commit 63d1573

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DockerfileWindows

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG BASEIMAGE
16-
FROM ${BASEIMAGE}
15+
ARG VERSION
16+
FROM mcr.microsoft.com/windows/servercore:$VERSION as core
17+
FROM mcr.microsoft.com/windows/nanoserver:$VERSION
18+
COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll
1719

1820
ADD build/windows/amd64/sonobuoy.exe /sonobuoy.exe
1921
WORKDIR /

scripts/build_funcs.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,12 @@ build_container_dockerfile_arch() {
8585
}
8686

8787
buildx_container_windows_version(){
88-
BASEIMAGE="$WIN_AMD64_BASEIMAGE:$1"
8988
mkdir -p "build/windows/$WIN_ARCH/$VERSION"
9089
docker buildx build --pull \
9190
--output=type=oci,dest=build/windows/$WIN_ARCH/$VERSION/sonobuoy-img-win-$WIN_ARCH-$VERSION-$GITHUB_RUN_ID.tar \
9291
--platform windows/amd64 \
9392
-t $REGISTRY/$TARGET:win-$WIN_ARCH-$VERSION-$IMAGE_VERSION \
94-
--build-arg BASEIMAGE=$BASEIMAGE \
93+
--build-arg VERSION=$1 \
9594
-f build/windows/$WIN_ARCH/Dockerfile \
9695
.
9796
}

0 commit comments

Comments
 (0)