Search code examples
quarkuspodman

How can I specify my own registry for Quarkus native image build?


I want to build my native image, but don't have GraalVM installed.

So, according to the documentation, this is what I do:

mvn clean package -Pnative -Dquarkus.native.container-build=true

We have Nexus acting as Image registry, and /etc/containers/registries.conf points to it:

[registries.search]
registries = [ 'our.nexus' ]

However, I still see Podman going directly onto the Internet, which makes the build terribly slow. We have a Firewall that analyzes anything that's downloaded.

 Trying to pull quay.io/quarkus/ubi-quarkus-native-image:22.0-java11...
 Getting image source signatures
 Copying blob 4f8ddd7f5a75 done
 Copying blob 54e56e6f8572 done
 Copying blob c7a9994ad8bb [--------------------------------------] 497.9KiB / 486.2MiB

And then I wait and wait and wait...

Why is Podman not using our registry? What Quarkus configuration do I need?


Solution

  • According to documentation you have to use this param to do the job

    -Dquarkus.native.builder-image=yourOwnRegistry/image:version
    

    I also used a lot jib which has distincts params, for example :

    mvnw clean install -Pnative
          -Dquarkus.jib.base-native-image=quay.io/quarkus/quarkus-micro-image:1.0
          -Dquarkus.container-image.builder=jib
          -Dquarkus.container-image.build=true
          -Dquarkus.container-image.push=true
    

    Which I currently use (tested, working on my pc and on gitlab CI)

    Relevant Native building docs and Jib/Docker/S2i docs