Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to the official host process containers base image #1221

Closed
jkroepke opened this issue Jun 7, 2023 · 11 comments · Fixed by #1507
Closed

Switch to the official host process containers base image #1221

jkroepke opened this issue Jun 7, 2023 · 11 comments · Fixed by #1507

Comments

@jkroepke
Copy link
Member

jkroepke commented Jun 7, 2023

See: https://github.com/microsoft/windows-host-process-containers-base-image#overview

To reduce the container size of windows_exporter, consider to use this image

mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 instead the nanoserver once.

@profnandaa
Copy link

/cc. @jsturtevant

@breed808
Copy link
Contributor

breed808 commented Aug 5, 2023

I'm happy to take a pull request for this change, but I have no way of testing the new image. Would someone be able to test this?

@jkroepke
Copy link
Member Author

jkroepke commented Aug 9, 2023

If you can provide the build image, I able to test it.

@breed808
Copy link
Contributor

You'd have to build it yourself, see the Dockerfile in the project repository. You can change the image there and test both the image build process and running of the built image.

@jkroepke
Copy link
Member Author

I didn't have any Windows environment with Docker. The AKS nodes are using containerd. Maybe its possible to build intermediate images through Github Actions

@breed808
Copy link
Contributor

I didn't have any Windows environment with Docker

Same here 😆. I'll have a look at Github Actions for this, I may be able to build an intermediate image in my forked version of the repo sometime this week

@PixelRobots
Copy link

PixelRobots commented Aug 31, 2023

You could use the Azure container registry to build the image.

az acr build --image sample/hello-world:v1
--registry myContainerRegistry008
--file Dockerfile .

https://learn.microsoft.com/en-us/azure/container-registry/container-registry-quickstart-task-cli

@jkroepke
Copy link
Member Author

jkroepke commented Nov 5, 2023

You can also build windows container on linux, using cross os builds

ARG BASE=mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0

FROM --platform=$BUILDPLATFORM golang:1.21 as builder
ARG TARGETARCH
ARG TARGETOS

# Get dependencies
WORKDIR /w
COPY go.mod go.sum ./
RUN go mod download
RUN go install github.com/prometheus/promu@latest

# Build windows_exporter
COPY . ./
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make windows_exporter.exe

FROM $BASE
COPY --from=builder /w/windows_exporter.exe /windows_exporter.exe
ENTRYPOINT ["windows_exporter.exe"]

Then

docker buildx build -t a --platform=windows/amd64 .

Copy link

github-actions bot commented Feb 4, 2024

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Feb 4, 2024
@jkroepke
Copy link
Member Author

jkroepke commented Feb 8, 2024

Unstale

@github-actions github-actions bot removed the Stale label Feb 9, 2024
Copy link

github-actions bot commented May 9, 2024

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants