Skip to content

Conversation

@TomerFi
Copy link
Contributor

@TomerFi TomerFi commented Oct 24, 2025

This PR adds Dockerfile-based build and push processes for both the Operator and ProxyRunner images. These UBI-based images are passing OpenShift-Preflight tests by introducing a more secure base image.

@TomerFi TomerFi force-pushed the containerfile-preflight branch from 874deb3 to 4f9dc0f Compare October 24, 2025 16:24
@JAORMX
Copy link
Collaborator

JAORMX commented Oct 24, 2025

@TomerFi I was more thinking about creating additional UBI images, not replacing the ones we have.

@JAORMX
Copy link
Collaborator

JAORMX commented Oct 24, 2025

Perhaps we could have a <version>-ubi tag for the images instead?

@TomerFi
Copy link
Contributor Author

TomerFi commented Oct 24, 2025

I was more thinking about creating additional UBI images, not replacing the ones we have.

@JAORMX , I'm not sure I follow, do you want two build processes to exist simultaneously? One using ko.build and one using Dockerfile?

@JAORMX
Copy link
Collaborator

JAORMX commented Oct 24, 2025

@TomerFi that's right

@TomerFi
Copy link
Contributor Author

TomerFi commented Oct 24, 2025

@JAORMX May I ask why?

@JAORMX
Copy link
Collaborator

JAORMX commented Oct 24, 2025

@TomerFi because I would like to keep the ko builds which use a more minimal container image.

@dmartinol
Copy link
Collaborator

@TomerFi I was more thinking about creating additional UBI images, not replacing the ones we have.

driven by env vars or always 2 images per application? in the first case, what's the default?
BUILD_TOOL=ko Vs BUILD_TOOL=dockerfile

@JAORMX
Copy link
Collaborator

JAORMX commented Oct 24, 2025

So, I was thinking of having:

ghcr.io/stacklok/toolhive-operator:v<version>      # ko-based image
ghcr.io/stacklok/toolhive-operator:v<version>-ubi  # UBI based image

How this happens is not super important to me. It could be another workflow that happens after the main build depending on the main release workflow. perhaps?

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.23%. Comparing base (5805898) to head (9529a17).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2327      +/-   ##
==========================================
- Coverage   54.27%   54.23%   -0.04%     
==========================================
  Files         242      242              
  Lines       23446    23446              
==========================================
- Hits        12725    12716       -9     
- Misses       9506     9520      +14     
+ Partials     1215     1210       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhrozek
Copy link
Contributor

jhrozek commented Oct 24, 2025

So, I was thinking of having:

ghcr.io/stacklok/toolhive-operator:v<version>      # ko-based image
ghcr.io/stacklok/toolhive-operator:v<version>-ubi  # UBI based image

How this happens is not super important to me. It could be another workflow that happens after the main build depending on the main release workflow. perhaps?

I like this scheme. As upstream, we should commit to maintaining UBI images - OpenShift is a very important downstream. But at the same I'd like us to keep the ko-based images as they are minimal, small and distroless.

As far as making it easier for clients to find and distinguish the images, perhaps we could add OCI image labels, e.g. dev.stacklok.toolhive.image-variant: UBI.

And I guess it would be nice to have a helm chart variable to easily switch between them.

(those can be another PR, just thinking out loud how to make life easier for consumers)

@TomerFi TomerFi force-pushed the containerfile-preflight branch 2 times, most recently from 3d74330 to 33d0b8e Compare October 27, 2025 19:55
@TomerFi TomerFi changed the title Switch operator to Dockerfile to pass preflight tests Add Dockerfile UBI images Oct 27, 2025
@TomerFi TomerFi changed the title Add Dockerfile UBI images Add Dockerfile UBI images for the Operator and ProxyRunner Oct 27, 2025
@TomerFi
Copy link
Contributor Author

TomerFi commented Oct 27, 2025

@JAORMX @jhrozek ^^

Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

I think this look good, I wouldn't mind pushing this as long as it keeps moving you forward. I wasn't sure about the LDFLAGS invocation though and left a question.

@TomerFi TomerFi force-pushed the containerfile-preflight branch from 2b2bc35 to ac773b2 Compare October 28, 2025 15:24
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
@TomerFi TomerFi force-pushed the containerfile-preflight branch 3 times, most recently from e511a36 to e9b313b Compare October 28, 2025 21:12
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
@JAORMX JAORMX enabled auto-merge (squash) October 29, 2025 07:23
@JAORMX JAORMX merged commit 2648cd4 into stacklok:main Oct 29, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants