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

feat: update validator target to be based on ubi-micro #1070

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions validator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -ldflags="-X 'kubevirt.i
-X 'kubevirt.io/ssp-operator/internal/template-validator/version.BRANCH=$BRANCH'\
-X 'kubevirt.io/ssp-operator/internal/template-validator/version.REVISION=$REVISION'" -o kubevirt-template-validator internal/template-validator/main.go

FROM registry.access.redhat.com/ubi9/ubi-minimal
FROM registry.access.redhat.com/ubi9/ubi-micro
RUN mkdir -p /etc/webhook/certs

RUN microdnf update -y && microdnf clean all
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksimon1, you've added this line a long time ago: #348

Do you remember why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can happen, that the released image contains vulnerabilities, which can be fixed by updating the packages with microdnf update -y

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksimon1, I appreciate your valid point. However, it's worth noting that the ubi-micro image contains significantly fewer packages, weighing in at 22.4 MB compared to 96.2 MB in the latest release.

Another important consideration is that running microdnf update can break the build if the host architecture differs from that of the container image, especially if no emulation is enabled.

Here’s an example of what I’m aiming to achieve: https://github.com/kubevirt/vm-console-proxy/blob/main/Dockerfile

In summary, my approach involves the following steps:

  1. Build everything from the host architecture in the builder image.
  2. Perform cross-compilation to the target architecture.
  3. Copy the binaries to a image with the target architecture.

What are your thoughts on this approach?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not saying your changes are wrong, I am just explaining why I added the command 2 years ago :)
It is great, that you are working on making it available on multiple architecture.
The approach you mentioned looks good 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! I truly appreciate your feedback 👍


WORKDIR /
COPY --from=builder /workspace/kubevirt-template-validator /usr/sbin/kubevirt-template-validator
USER 1000
Expand Down