Open matzew opened 2 months ago
/cc @maxandersen (podman)
using the jib
extension (just to test things) it works
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Starting (local) container image build for jar using jib.
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using podman to run the native image builder
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19' does not use a specific image digest - build may not be reproducible
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:1431c7b8b4ebe450d2ad67029b0310c93ca878224ac0917818ea93ba50411cba
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Container entrypoint set to [/opt/jboss/container/java/run/run-java.sh]
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Created container image matzew/code-with-quarkus:1.0.0-SNAPSHOT (sha256:8d101da2b0e645ae7943bd9a93e89cccbccce68107df5f97bdc647f4c7bcf6a3)
A little update, for shake of podman
versus pack
, I did:
sudo ln -s /tmp/docker.sock /var/run/docker.sock
and added this to my application.properties
file:
quarkus.container-image.group=matzew
quarkus.container-image.registry=docker.io
quarkus.buildpack.jvm-builder-image=ghcr.io/knative/builder-jammy-tiny:0.0.264
but that gave me this error:
[INFO] --- quarkus:3.12.2:build (default) @ code-with-quarkus ---
[INFO] [io.quarkus.container.image.buildpack.deployment.BuildpackProcessor] Starting (local) container image build for jar using buildpack.
[INFO] [io.quarkus.container.image.buildpack.deployment.BuildpackProcessor] Initiating Buildpack build
[INFO] Buildpack build invoked, preparing environment...
[INFO] Build configured with..
[INFO] - build image : ghcr.io/knative/builder-jammy-tiny:0.0.264
[INFO] - run image : docker.io/paketobuildpacks/run-jammy-tiny:latest
[INFO] - build volumes created
[INFO] - mounted buildpack-build-oiersjufwe at /bld
[INFO] - mounted buildpack-launch-sirggszdos at /launch
[INFO] - mounted buildpack-app-jusszllipt at /app
[INFO] - mounted buildpack-platform-exgygnspwo at /platform
[INFO] - mounted /var/run/docker.sock at /var/run/docker.sock
[INFO] - mounted buildpack-output-bwkldalkge at /out
[INFO] - build container id 3f1266c3d86420b3624bf620f0f89c6b50778fcbd6624e14c9e0415bf9efdd22
[INFO] - uploaded archive to container at /app/content
[INFO] - uploaded env to container at /platform/env
[INFO] - launching build container
[INFO] - attaching log relay
ERROR: failed to set platform API: platform API version '0.4' is incompatible with the lifecycle
[INFO] Buildpack build complete, with exit code 11
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.703 s
[INFO] Finished at: 2024-07-15T16:29:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.12.2:build (default) on project code-with-quarkus: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.container.image.buildpack.deployment.BuildpackProcessor#buildFromJar threw an exception: java.lang.IllegalStateException: Buildpack build failed
[ERROR] at io.quarkus.container.image.buildpack.deployment.BuildpackProcessor.runBuildpackBuild(BuildpackProcessor.java:211)
[ERROR] at io.quarkus.container.image.buildpack.deployment.BuildpackProcessor.buildFromJar(BuildpackProcessor.java:89)
[ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[ERROR] at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:1570)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:483)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
CC @BarDweller
quarkus.buildpack.jvm-builder-image=ghcr.io/knative/builder-jammy-tiny:0.0.264
That is probably not necessary the default builder works a little bit better by which I mean it fails little bit latter.
It appears that property quarkus.buildpack.docker-host
can be used to configure the socket, however it's not documented and it still should honor DOCKER_HOST
but it does not do that.
The current buildpack implementation in quarkus will not work with podman.. The new release of the snowdrop buildpack library addresses some podman compatibility issues, and has been tested with podman and docker daemons.
I'll tag this Issue when I raise the PR to update quarkus to the new library revision. Should be within a few days.
Describe the bug
The buildpack extension seems to not work with
podman
, as I am getting:Expected behavior
Works with Podman :smile:
Actual behavior
Unable to build like:
as it gives the above error
How to Reproduce?
I created a new empty project, from this page: https://quarkus.io/extensions/io.quarkus/quarkus-container-image-buildpack/?tab=docs
TRY THIS EXTENSION,
After unzipping the bundle, I ran:
which fails
Output of
uname -a
orver
Linux fedora 6.9.6-200.fc40.x86_64
Output of
java -version
java --version openjdk 21.0.3 2024-04-16 OpenJDK Runtime Environment (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9) OpenJDK 64-Bit Server VM (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9, mixed mode, sharing)
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Output from
podman info
: