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

Docker-build fails to detect podman #41085

Closed
fedinskiy opened this issue Jun 10, 2024 · 28 comments · Fixed by #41100
Closed

Docker-build fails to detect podman #41085

fedinskiy opened this issue Jun 10, 2024 · 28 comments · Fixed by #41100
Labels
area/container-image kind/bug Something isn't working
Milestone

Comments

@fedinskiy
Copy link
Contributor

Describe the bug

I have an application, which uses quarkus-container-image-docker extension and I am trying to build the app on a machine with podman. It works for released version of Quarkus, but fails for SNAPSHOT (starting from the 1st of June 2024)

Expected behavior

Build succeeds

Actual behavior

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT: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.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.IllegalStateException: No container runtime was found. Make sure you have either Docker or Podman installed in your environment.
[ERROR] 	at io.quarkus.deployment.util.ContainerRuntimeUtil.detectContainerRuntime(ContainerRuntimeUtil.java:68)
[ERROR] 	at io.quarkus.deployment.util.ContainerRuntimeUtil.detectContainerRuntime(ContainerRuntimeUtil.java:50)
[ERROR] 	at io.quarkus.container.image.docker.common.deployment.CommonProcessor.lambda$getExecutableName$9(CommonProcessor.java:262)
[ERROR] 	at java.base/java.util.Optional.orElseGet(Optional.java:364)
[ERROR] 	at io.quarkus.container.image.docker.common.deployment.CommonProcessor.getExecutableName(CommonProcessor.java:262)
[ERROR] 	at io.quarkus.container.image.docker.common.deployment.CommonProcessor.buildFromJar(CommonProcessor.java:87)
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerBuildFromJar(DockerProcessor.java:62)
[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:1583)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:483)
[ERROR] -> [Help 1]

How to Reproduce?

  1. wget -O app.zip "https://code.quarkus.io/d?e=rest&e=container-image-docker&cn=code.quarkus.io"
  2. unzip -q app.zip && cd code-with-quarkus/
  3. This succeeds: mvn clean verify -Dquarkus.platform.version=3.11.0 -Dquarkus.container-image.build=true
  4. This fails: mvn clean verify -Dquarkus.platform.group-id=io.quarkus -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.container-image.build=true

Output of uname -a or ver

6.7.3-200.fc39.x86_64

Output of java -version

Java version: 21.0.1, vendor: Eclipse Adoptium

Quarkus version or git rev

6bc64a0 (the earliest affected build)

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

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

$ docker --version
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
podman version 5.0.3
@geoand
Copy link
Contributor

geoand commented Jun 10, 2024

cc @edeandrea

@edeandrea
Copy link
Contributor

mvn clean verify -Dquarkus.platform.version=3.11.0 -Dquarkus.container-image.build=true actually fails for me...

╭─ ~/Desktop/test/code-with-quarkus ············································································· ✔  system Node 
╰─ ./mvnw clean verify -Dquarkus.platform.version=3.11.0 -Dquarkus.container-image.build=true
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ code-with-quarkus ---
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ code-with-quarkus ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- quarkus:3.11.0:generate-code (default) @ code-with-quarkus ---
Downloading from central: https://repo1.maven.org/maven2/org/acme/code-with-quarkus/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] 
[INFO] --- compiler:3.12.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 1 source file with javac [debug release 21] to target/classes
[INFO] 
[INFO] --- quarkus:3.11.0:generate-code-tests (default) @ code-with-quarkus ---
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ code-with-quarkus ---
[INFO] skip non existing resourceDirectory /Users/edeandre/Desktop/test/code-with-quarkus/src/test/resources
[INFO] 
[INFO] --- compiler:3.12.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 2 source files with javac [debug release 21] to target/test-classes
[INFO] Annotation processing is enabled because one or more processors were found
  on the class path. A future release of javac may disable annotation processing
  unless at least one processor is specified by name (-processor), or a search
  path is specified (--processor-path, --processor-module-path), or annotation
  processing is enabled explicitly (-proc:only, -proc:full).
  Use -Xlint:-options to suppress this message.
  Use -proc:none to disable annotation processing.
[INFO] 
[INFO] --- surefire:3.2.5:test (default-test) @ code-with-quarkus ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.GreetingResourceTest
2024-06-10 07:57:59,128 INFO  [io.quarkus] (main) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.11.0) started in 0.987s. Listening on: http://localhost:8081
2024-06-10 07:57:59,129 INFO  [io.quarkus] (main) Profile test activated. 
2024-06-10 07:57:59,130 INFO  [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.667 s -- in org.acme.GreetingResourceTest
2024-06-10 07:57:59,678 INFO  [io.quarkus] (main) code-with-quarkus stopped in 0.010s
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ code-with-quarkus ---
[INFO] Building jar: /Users/edeandre/Desktop/test/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT.jar
[INFO] 
[INFO] --- quarkus:3.11.0:build (default) @ code-with-quarkus ---
[WARNING] [io.quarkus.deployment.util.ContainerRuntimeUtil] Command "docker info" exited with error code 1. Rootless container runtime detection might not be reliable or the container service is not running at all.
[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 /Users/edeandre/Desktop/test/code-with-quarkus/src/main/docker/Dockerfile.jvm -t edeandre/code-with-quarkus:1.0.0-SNAPSHOT /Users/edeandre/Desktop/test/code-with-quarkus'
[INFO] [io.quarkus.deployment.util.ExecUtil] ERROR: Cannot connect to the Docker daemon at unix:///Users/edeandre/.docker/run/docker.sock. Is the docker daemon running?
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.188 s
[INFO] Finished at: 2024-06-10T07:58:01-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.11.0: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.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.RuntimeException: Execution of 'docker build -f /Users/edeandre/Desktop/test/code-with-quarkus/src/main/docker/Dockerfile.jvm -t edeandre/code-with-quarkus:1.0.0-SNAPSHOT /Users/edeandre/Desktop/test/code-with-quarkus' failed. See docker output for more details
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerException(DockerProcessor.java:339)
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.createContainerImage(DockerProcessor.java:198)
[ERROR] 	at io.quarkus.container.image.docker.deployment.DockerProcessor.dockerBuildFromJar(DockerProcessor.java:103)
[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:1583)
[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] 
[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

@fedinskiy
Copy link
Contributor Author

@edeandrea do you have podman running? Does socket accept connections? What does docker info/podman info show?

@edeandrea
Copy link
Contributor

Yeah I have podman running but I think my docker -> podman bridge is hosed :(

@cescoffier
Copy link
Member

I think we do not recommend the docker alias anymore.
Do you have podman in your PATH?

Note that I think it would be good to first check for podman and not docker to avoid that kind of issue.

@fedinskiy
Copy link
Contributor Author

@cescoffier is this question for me or for Eric? I have podman on PATH as well:

$ podman info
host:
  arch: amd64
  buildahVersion: 1.35.4

@cescoffier
Copy link
Member

@fedinskiy Can you try without having docker in the PATH, just to make sure it works?

@fedinskiy
Copy link
Contributor Author

@cescoffier

$ sudo dnf rm podman-docker
<...>
$ docker info
bash: /usr/bin/docker: No such file or directory
$ mvn clean verify -Dquarkus.platform.version=3.11.0 -Dquarkus.container-image.build=true # works
$ mvn clean verify -Dquarkus.platform.group-id=io.quarkus -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.container-image.build=true # fails with the same error

@edeandrea
Copy link
Contributor

With quarkus 3.12 there is a new container-image-podman extension.

https://quarkus.io/version/main/guides/container-image#podman

@edeandrea
Copy link
Contributor

I can reproduce this though - taking a look at it

@fedinskiy
Copy link
Contributor Author

@edeandrea original test works with quarkus-container-image-podman. At the same time, it would be nice to have a backward compatibility during the same major version.

@edeandrea
Copy link
Contributor

At the same time, it would be nice to have a backward compatibility during the same major version.

It should work. I'm taking a look.

@edeandrea
Copy link
Contributor

@geoand / @cescoffier here's a question - should this use case continue to work? If no docker installed and using the container-image-docker extension, I'm not sure it should then look for podman? WDYT?

@geoand
Copy link
Contributor

geoand commented Jun 10, 2024

Yeah, that's tricky. I think we can make some effort on that front.
If we don't we need to mark the PR as a breaking change

@edeandrea
Copy link
Contributor

I can probably make the docker extension look for podman (like it used to), but I'd prefer not to make the podman extension look for docker.

@geoand
Copy link
Contributor

geoand commented Jun 10, 2024

That doesn't help users who already have the extension (obviously since it didn't exist until you added it), they will remain broken

@edeandrea
Copy link
Contributor

That doesn't help users who already have the extension (obviously since it didn't exist until you added it), they will remain broken

I'm not sure I understand this comment. If the docker extension will look for podman (like it used to) would that suffice?

@geoand
Copy link
Contributor

geoand commented Jun 10, 2024

If the docker extension will look for podman (like it used to) would that suffice?

Yeah, because that doesn't break the behavior for users. If we did it the other way around like you mentioned in the previous comment (unless I misunderstood what you were saying), then it would still be breaking behavior

@edeandrea
Copy link
Contributor

what i was saying re: the new container-image-podman extension is that it would only care about podman. I can probably add something to the container-image-docker extension which makes it backwards compatible. Maybe in that case too I print a warning out to the console?

@geoand
Copy link
Contributor

geoand commented Jun 10, 2024

That all makes sense to me

@edeandrea
Copy link
Contributor

So I've been doing some more testing. My laptop was in some weird state before, so I've cleaned out both Docker & Podman and only reinstalled podman.

I'm now not able to reproduce what @fedinskiy is seeing. With the container-image-docker extension it successfully finds podman and uses it to do the build.

See below output:

╭─ ~/Desktop/test/code-with-quarkus ········································································ ✔  11s  system Node 
╰─ docker info   
zsh: command not found: docker

╭─ ~/Desktop/test/code-with-quarkus ········································································· 127 х  system Node 
╰─ podman info   
host:
  arch: arm64
  buildahVersion: 1.35.4
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc40.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 99.12
    systemPercent: 0.37
    userPercent: 0.51
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "40"
  eventLogger: journald
  freeLocks: 2023
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.8.8-300.fc40.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 4671762432
  memTotal: 5754200064
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc40.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.3-3.fc40.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.3
  ociRuntime:
    name: crun
    package: crun-1.14.4-1.fc40.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.14.4
      commit: a220ca661ce078f2c37b38c92e66cf66c012d9c1
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240426.gd03c4e2-1.fc40.aarch64
    version: |
      pasta 0^20240426.gd03c4e2-1.fc40.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-2.fc40.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 0h 13m 26.00s
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 99252940800
  graphRootUsed: 11399651328
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 57
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.0.3
  Built: 1715299200
  BuiltTime: Thu May  9 20:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.2
  Os: linux
  OsArch: linux/arm64
  Version: 5.0.3

Build with Quarkus 3.11

╭─ ~/Desktop/test/code-with-quarkus ············································································· ✔  system Node 
╰─ ./mvnw clean verify -Dquarkus.platform.version=3.11.0 -Dquarkus.container-image.build=true
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ code-with-quarkus ---
[INFO] Deleting /Users/edeandre/Desktop/test/code-with-quarkus/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ code-with-quarkus ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- quarkus:3.11.0:generate-code (default) @ code-with-quarkus ---
[INFO] 
[INFO] --- compiler:3.12.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 1 source file with javac [debug release 21] to target/classes
[INFO] 
[INFO] --- quarkus:3.11.0:generate-code-tests (default) @ code-with-quarkus ---
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ code-with-quarkus ---
[INFO] skip non existing resourceDirectory /Users/edeandre/Desktop/test/code-with-quarkus/src/test/resources
[INFO] 
[INFO] --- compiler:3.12.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 2 source files with javac [debug release 21] to target/test-classes
[INFO] Annotation processing is enabled because one or more processors were found
  on the class path. A future release of javac may disable annotation processing
  unless at least one processor is specified by name (-processor), or a search
  path is specified (--processor-path, --processor-module-path), or annotation
  processing is enabled explicitly (-proc:only, -proc:full).
  Use -Xlint:-options to suppress this message.
  Use -proc:none to disable annotation processing.
[INFO] 
[INFO] --- surefire:3.2.5:test (default-test) @ code-with-quarkus ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.GreetingResourceTest
2024-06-10 11:48:27,151 INFO  [io.quarkus] (main) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.11.0) started in 1.076s. Listening on: http://localhost:8081
2024-06-10 11:48:27,152 INFO  [io.quarkus] (main) Profile test activated. 
2024-06-10 11:48:27,152 INFO  [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.726 s -- in org.acme.GreetingResourceTest
2024-06-10 11:48:27,697 INFO  [io.quarkus] (main) code-with-quarkus stopped in 0.010s
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ code-with-quarkus ---
[INFO] Building jar: /Users/edeandre/Desktop/test/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT.jar
[INFO] 
[INFO] --- quarkus:3.11.0:build (default) @ code-with-quarkus ---
[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: 'podman build -f /Users/edeandre/Desktop/test/code-with-quarkus/src/main/docker/Dockerfile.jvm -t edeandre/code-with-quarkus:1.0.0-SNAPSHOT /Users/edeandre/Desktop/test/code-with-quarkus'
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 1/11: FROM registry.access.redhat.com/ubi8/openjdk-21:1.18
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 2/11: ENV LANGUAGE='en_US:en'
[INFO] [io.quarkus.deployment.util.ExecUtil] --> Using cache 8b11a860e07183646fab60644c12e6d8d73f0777c977a59ba536a8a263e6297b
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 8b11a860e071
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 3/11: COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> Using cache d8b8aad13abc963c03f5030a216cb14c9a10e5e015d8eb593d2c9f358b8852ac
[INFO] [io.quarkus.deployment.util.ExecUtil] --> d8b8aad13abc
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 4/11: COPY --chown=185 target/quarkus-app/*.jar /deployments/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 7e08b362ff58
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 5/11: COPY --chown=185 target/quarkus-app/app/ /deployments/app/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 844cb8a5b4d5
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 6/11: COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 3486735a67cd
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 7/11: EXPOSE 8080
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 0174dca3a1ff
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 8/11: USER 185
[INFO] [io.quarkus.deployment.util.ExecUtil] --> cc1ea348552b
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 9/11: ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 666e76e911b0
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 10/11: ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 5105b41b1606
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 11/11: ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
[INFO] [io.quarkus.deployment.util.ExecUtil] COMMIT edeandre/code-with-quarkus:1.0.0-SNAPSHOT
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 8190526b5904
[INFO] [io.quarkus.deployment.util.ExecUtil] Successfully tagged localhost/edeandre/code-with-quarkus:1.0.0-SNAPSHOT
[INFO] [io.quarkus.deployment.util.ExecUtil] 8190526b59041cfc2dfed2b7066bff09ccb9ebc6c3e54144f6d6f560e3d89a30
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Built container image edeandre/code-with-quarkus:1.0.0-SNAPSHOT

[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 4357ms
[INFO] 
[INFO] --- failsafe:3.2.5:integration-test (default) @ code-with-quarkus ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- failsafe:3.2.5:verify (default) @ code-with-quarkus ---
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.909 s
[INFO] Finished at: 2024-06-10T11:48:32-04:00
[INFO] ------------------------------------------------------------------------

Build with Quarkus snapshot

╭─ ~/Desktop/test/code-with-quarkus ········································································ ✔  11s  system Node 
╰─ ./mvnw clean verify -Dquarkus.platform.group-id=io.quarkus -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.container-image.build=true                                                                                   
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ code-with-quarkus ---
[INFO] Deleting /Users/edeandre/Desktop/test/code-with-quarkus/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ code-with-quarkus ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:generate-code (default) @ code-with-quarkus ---
[INFO] 
[INFO] --- compiler:3.12.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 1 source file with javac [debug release 21] to target/classes
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:generate-code-tests (default) @ code-with-quarkus ---
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ code-with-quarkus ---
[INFO] skip non existing resourceDirectory /Users/edeandre/Desktop/test/code-with-quarkus/src/test/resources
[INFO] 
[INFO] --- compiler:3.12.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 2 source files with javac [debug release 21] to target/test-classes
[INFO] Annotation processing is enabled because one or more processors were found
  on the class path. A future release of javac may disable annotation processing
  unless at least one processor is specified by name (-processor), or a search
  path is specified (--processor-path, --processor-module-path), or annotation
  processing is enabled explicitly (-proc:only, -proc:full).
  Use -Xlint:-options to suppress this message.
  Use -proc:none to disable annotation processing.
[INFO] 
[INFO] --- surefire:3.2.5:test (default-test) @ code-with-quarkus ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.GreetingResourceTest
2024-06-10 11:50:01,290 INFO  [io.quarkus] (main) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 1.051s. Listening on: http://localhost:8081
2024-06-10 11:50:01,292 INFO  [io.quarkus] (main) Profile test activated. 
2024-06-10 11:50:01,292 INFO  [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.691 s -- in org.acme.GreetingResourceTest
2024-06-10 11:50:01,823 INFO  [io.quarkus] (main) code-with-quarkus stopped in 0.010s
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ code-with-quarkus ---
[INFO] Building jar: /Users/edeandre/Desktop/test/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT.jar
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:build (default) @ code-with-quarkus ---
[INFO] [io.quarkus.container.image.docker.common.deployment.CommonProcessor] Starting (local) container image build for jar using docker
[INFO] [io.quarkus.container.image.docker.common.deployment.CommonProcessor] Executing the following command to build image: 'podman build -f /Users/edeandre/Desktop/test/code-with-quarkus/src/main/docker/Dockerfile.jvm -t edeandre/code-with-quarkus:1.0.0-SNAPSHOT /Users/edeandre/Desktop/test/code-with-quarkus'
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 1/11: FROM registry.access.redhat.com/ubi8/openjdk-21:1.18
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 2/11: ENV LANGUAGE='en_US:en'
[INFO] [io.quarkus.deployment.util.ExecUtil] --> Using cache 8b11a860e07183646fab60644c12e6d8d73f0777c977a59ba536a8a263e6297b
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 8b11a860e071
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 3/11: COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> Using cache a54d83cc1c82863fa4d8e8f50663e29c88b4c5c106fdba779065790144108cb4
[INFO] [io.quarkus.deployment.util.ExecUtil] --> a54d83cc1c82
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 4/11: COPY --chown=185 target/quarkus-app/*.jar /deployments/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 6fe21c4ee524
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 5/11: COPY --chown=185 target/quarkus-app/app/ /deployments/app/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 2dfb12749e23
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 6/11: COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 0379013de8c1
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 7/11: EXPOSE 8080
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 93186eddd51b
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 8/11: USER 185
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 67c02d69e490
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 9/11: ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 8605e40a210c
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 10/11: ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
[INFO] [io.quarkus.deployment.util.ExecUtil] --> d7859c655f26
[INFO] [io.quarkus.deployment.util.ExecUtil] STEP 11/11: ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
[INFO] [io.quarkus.deployment.util.ExecUtil] COMMIT edeandre/code-with-quarkus:1.0.0-SNAPSHOT
[INFO] [io.quarkus.deployment.util.ExecUtil] --> 6db9af3a847b
[INFO] [io.quarkus.deployment.util.ExecUtil] Successfully tagged localhost/edeandre/code-with-quarkus:1.0.0-SNAPSHOT
[INFO] [io.quarkus.deployment.util.ExecUtil] 6db9af3a847b0ad1b0e63d10e8e2af5d6ae98b8ebe1bf8d91c0484728fb0dd6e
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Built container image edeandre/code-with-quarkus:1.0.0-SNAPSHOT

[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 4243ms
[INFO] 
[INFO] --- failsafe:3.2.5:integration-test (default) @ code-with-quarkus ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- failsafe:3.2.5:verify (default) @ code-with-quarkus ---
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.904 s
[INFO] Finished at: 2024-06-10T11:50:06-04:00
[INFO] ------------------------------------------------------------------------

@edeandrea
Copy link
Contributor

I then went ahead and followed https://podman-desktop.io/docs/migrating-from-docker/using-podman-mac-helper and also installed the docker cli:

brew install docker docker-compose docker-credential-helper

And verified the docker socket

╭─ ~/Desktop/test/code-with-quarkus ············································································· ✔  system Node 
╰─ docker context list      
NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock 

╭─ ~/Desktop/test/code-with-quarkus ············································································· ✔  system Node 
╰─ ls -al /var/run/docker.sock
lrwxr-xr-x  1 root  daemon  66 Jun 10 12:10 /var/run/docker.sock -> /Users/edeandre/.local/share/containers/podman/machine/podman.sock

And then re-verified the builds, and still can't reproduce

edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 10, 2024
@edeandrea
Copy link
Contributor

Regardless of not being able to reproduce, I think there are some changes I can make. See #41100

edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 10, 2024
edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 10, 2024
edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 10, 2024
edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 10, 2024
@maxandersen
Copy link
Member

+1 on not bresking past automatic container runtime detection.

I probably missed this - but whats the point of having a separate podman extension ? What does it provide ?

@edeandrea
Copy link
Contributor

edeandrea commented Jun 11, 2024

It provides the ability to do podman specific things (like building multi-arch images). We have that on the docker extension side, but it requires the use of the docker buildx plugin, which is specific to the docker runtime. Podman can do it, but it has its own unique way of doing it. Thats just one difference. There are others where docker & podman (& the other container-image extensions) deviate.

Also, if you had both installed it always picked docker. You had to set quarkus.docker.executable-name=podman in order to force it to use podman.

See #40699 for the full details.

edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 11, 2024
edeandrea added a commit to edeandrea/quarkus that referenced this issue Jun 11, 2024
@edeandrea
Copy link
Contributor

@fedinskiy is it possible to check out #41100, build it like you would Quarkus main, and see if it fixes your mvn clean verify -Dquarkus.platform.group-id=io.quarkus -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.container-image.build=true?

@fedinskiy
Copy link
Contributor Author

@edeandrea worked for b90b893

@gsmet gsmet closed this as completed in b90b893 Jun 12, 2024
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone Jun 12, 2024
@edeandrea
Copy link
Contributor

@edeandrea worked for b90b893

Thanks for verifying @fedinskiy !

ppalaga added a commit to ppalaga/quarkus that referenced this issue Jun 12, 2024
detectContainerRuntime() method for backwards compatibility
gsmet added a commit that referenced this issue Jun 14, 2024
Fixup #41085 Docker-build fails to detect podman: add back detectContainerRuntime() method for backwards compatibility
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 14, 2024
detectContainerRuntime() method for backwards compatibility

(cherry picked from commit 7c176b6)
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
detectContainerRuntime() method for backwards compatibility
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
detectContainerRuntime() method for backwards compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants