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

Automatic build of Docker image fails when running with podman #28721

Closed
Tracked by #31253
fedinskiy opened this issue Oct 20, 2022 · 7 comments
Closed
Tracked by #31253

Automatic build of Docker image fails when running with podman #28721

fedinskiy opened this issue Oct 20, 2022 · 7 comments
Milestone

Comments

@fedinskiy
Copy link
Contributor

Describe the bug

I have an application with quarkus-resteasy-jackson and quarkus-container-image-docker dependecies and with property quarkus.container-image.build set to true. When I run mvn clean package while using docker as a contanier runtime, everything works as expected. When I run the same command, while using podman socket I get an error.

Expected behavior

Result of build command should not depend on used container runtime.

Actual behavior

[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Starting (local) container image build for jar using docker.
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Executing the following command to build docker image: 'docker build -f /home/fedinskiy/code/quarkus/refresh/reproducer/src/main/docker/Dockerfile.jvm -t qe/hello-world-app:1.0.0 /home/fedinskiy/code/quarkus/refresh/reproducer'
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Sending build context to Docker daemon  16.45MB
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] request returned Bad Request for API route and version http://%2Frun%2Fuser%2F1000%2Fpodman%2Fpodman.sock/v1.41/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=src%2Fmain%2Fdocker%2FDockerfile.jvm&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=qe%2Fhello-world-app%3A1.0.0&target=&ulimits=null&version=1, check if the server supports the requested API version
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.880 s
[INFO] Finished at: 2022-10-20T16:03:18+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.13.3.Final:build (default) on project reproducer: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] 	[error]: Build step io.quarkus.container.image.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.RuntimeException: Execution of 'docker build -f /home/fedinskiy/code/quarkus/refresh/reproducer/src/main/docker/Dockerfile.jvm -t qe/hello-world-app:1.0.0 /home/fedinskiy/code/quarkus/refresh/reproducer' failed. See docker output for more details
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerException(DockerProcessor.java:330)
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.createContainerImage(DockerProcessor.java:199)
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerBuildFromJar(DockerProcessor.java:106)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[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] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

How to Reproduce?

  1. Clone the reproducer: [email protected]:fedinskiy/reproducer.git -b reproducer/build-podman
  2. Set up podman and podman socket:
    a. sudo dnf install podman podman-docker
    b .systemctl --user enable podman.socket --now
    c. export DOCKER_HOST=unix:///run/user/${UID}/podman/podman.sock && export TESTCONTAINERS_RYUK_DISABLED=true
  3. run mvn clean package
    If step 2 is ommited, everything works as expected.
    For comparison, manual build works flawlessly:
  4. mvn clean package -Dquarkus.container-image.build=false
  5. podman build -f src/main/docker/Dockerfile.jvm -t quarkus/getting-started-jvm .

Output of uname -a or ver

5.19.11-200.fc36.x86_64

Output of java -version

11.0.16 temurin

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

podman version 4.2.1
Docker version 20.10.19, build d85ef84

@geoand
Copy link
Contributor

geoand commented Oct 21, 2022

@gastaldi any chance you can take a look at this one?

@gastaldi
Copy link
Contributor

@geoand I using a mac and don't have Fedora in my machine 😞

Let me see if I can reproduce that in a VM

@geoand
Copy link
Contributor

geoand commented Oct 21, 2022

Oh, I thought you were on Fedora

@gastaldi
Copy link
Contributor

I have to pass, I tried but had no luck without requiring payment 😞

@holly-cummins
Copy link
Contributor

It makes me think we should be running some of the native tests on M1. That's a different OS, but it's also podman so will flush out some of these issues.

Or, alternatively, we could have a matrix job which ran on the normal hardware but forced podman as the container runtime.

@fedinskiy
Copy link
Contributor Author

fixed by #41100

@geoand geoand added this to the 3.12.0.CR1 milestone Sep 18, 2024
@geoand
Copy link
Contributor

geoand commented Sep 18, 2024

Thanks for checking!

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

No branches or pull requests

4 participants