Skip to content

Commit

Permalink
Add netapi32.dll to windows images
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
johnSchnake committed May 18, 2021
1 parent 4d28adf commit 63d1573
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions DockerfileWindows
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

ADD build/windows/amd64/sonobuoy.exe /sonobuoy.exe
WORKDIR /
Expand Down
3 changes: 1 addition & 2 deletions scripts/build_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ build_container_dockerfile_arch() {
}

buildx_container_windows_version(){
BASEIMAGE="$WIN_AMD64_BASEIMAGE:$1"
mkdir -p "build/windows/$WIN_ARCH/$VERSION"
docker buildx build --pull \
--output=type=oci,dest=build/windows/$WIN_ARCH/$VERSION/sonobuoy-img-win-$WIN_ARCH-$VERSION-$GITHUB_RUN_ID.tar \
--platform windows/amd64 \
-t $REGISTRY/$TARGET:win-$WIN_ARCH-$VERSION-$IMAGE_VERSION \
--build-arg BASEIMAGE=$BASEIMAGE \
--build-arg VERSION=$1 \
-f build/windows/$WIN_ARCH/Dockerfile \
.
}
Expand Down

0 comments on commit 63d1573

Please sign in to comment.