-
Notifications
You must be signed in to change notification settings - Fork 41.1k
gradlew bootBuildImage fails with Podman on macOS Sonoma #39830
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
Comments
The Spring Boot Gradle plugin documentation includes an example of configuring the plugin for use with podman. The podman compatibility mode that creates a symlink for Please try configuring the plugin as documented and let us know if that works. |
@scottfrederick I experienced the same issue. If I downgrade Spring Boot from 3.2.3 to 3.1.9, the Also, I tried out the same test using Maven instead of Gradle, and the So, it seems to be a problem specific to Spring Boot 3.2.x with Gradle. |
Apologies, I completely forgot that section of the manual. Before providing more details I'd like to note that the changes suggested by the manual are a bit misleading for people on macOS. First, the following line is valid only for Linux. On macOS host.set("unix:///run/user/1000/podman/podman.sock") The podman command for finding the socket is also wrong on macOS: $ podman info --format='{{.Host.RemoteSocket.Path}}'
/run/podman/podman.sock
$ ls -l /run/podman/podman.sock
ls: /run/podman/podman.sock: No such file or directory In the following comments I will highlight the specific problems I am still having. |
With
I get (abbreviated): $ ./gradlew clean bootBuildImage
> Task :bootBuildImage
Building image 'docker.io/library/spring-podman:0.0.1-SNAPSHOT'
> Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' ..................................................
> Pulled builder image 'docker.io/paketobuildpacks/builder-jammy-base@sha256:94593b2ad54362e1256da43631661d3dad936a177609a3d297fc638e87c6ee91'
> Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' ..................................................
> Pulled run image 'docker.io/paketobuildpacks/run-jammy-base@sha256:c2bc9ac828642aee2376a649ef5affd6912507c739247a40086bcae6d62a8b41'
> Executing lifecycle version v0.18.5
> Using build cache volume 'pack-cache-f19174dfe539.build'
> Running creator
[creator] ===> ANALYZING
[creator] ERROR: failed to initialize analyzer: getting previous image: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 1
BUILD FAILED in 6s
6 actionable tasks: 6 executed
$ ls -l /var/run/docker.sock
lrwxr-xr-x 1 root daemon 75 Mar 6 08:52 /var/run/docker.sock -> /Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock |
This is interesting. With host.set("unix:///Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock") I get: $ ./gradlew clean bootBuildImage
> Task :bootBuildImage
Building image 'docker.io/library/spring-podman:0.0.1-SNAPSHOT'
> Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' ..................................................
> Pulled builder image 'docker.io/paketobuildpacks/builder-jammy-base@sha256:94593b2ad54362e1256da43631661d3dad936a177609a3d297fc638e87c6ee91'
> Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' ..................................................
> Pulled run image 'docker.io/paketobuildpacks/run-jammy-base@sha256:c2bc9ac828642aee2376a649ef5affd6912507c739247a40086bcae6d62a8b41'
> Executing lifecycle version v0.18.5
> Using build cache volume 'pack-cache-f19174dfe539.build'
> Running creator
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Docker API call to '/Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock/v1.24/containers/create' failed with status code 500 "Internal Server Error" and message "container create: statfs /Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock: operation not supported"
BUILD FAILED in 4s
$ ls -l /Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock
lrwxr-xr-x@ 1 andrea.cisternino staff 80 Feb 2 09:23 /Users/andrea.cisternino/.local/share/containers/podman/machine/podman.sock -> /Users/andrea.cisternino/.local/share/containers/podman/machine/qemu/podman.sock |
Finally, with host.set("unix:///Users/andrea.cisternino/.local/share/containers/podman/machine/qemu/podman.sock") I get the exact same result as above. For info: $ ls -l /Users/andrea.cisternino/.local/share/containers/podman/machine/qemu/podman.sock
srw------- 1 andrea.cisternino staff 0 Mar 6 08:52 /Users/andrea.cisternino/.local/share/containers/podman/machine/qemu/podman.sock |
I also happened to get the exact same error when using 3.2.2 using Gradle Kotlin.
|
There appears to be a few different things going on here. First, there is the issue of Podman Desktop's Docker compatibility mode.
As stated above, this compatibility mode socket symlink works for the code in the Spring Boot plugins that connect to the daemon using the Docker socket. However, the Second, there is the issue of the
The only other guidance I've seen in the Podman documentation is to set the socket address to
@ThomasVitale This is very surprising, since the code that is specific to the Maven and Gradle plugins is very thin and the vast majority of the code that builds images is the same between the two plugins. We'll have to do more testing to see if we can reproduce this difference. If anyone is able to test their Podman on macOS configuration using the |
Seems to work for me when enabling Docker compatibility and installing podman-mac-helper. |
Interesting. @sdeleuze I have checked my environment and I have I went through the documentation and I can confirm that all the steps in the Verification paragraph are indeed OK on my machine but the build still fails with the same errors as above. @scottfrederick I am no $ pack build spring-podman --builder=gcr.io/buildpacks/builder --env GOOGLE_RUNTIME_VERSION=21
$ pack build spring-podman --builder=paketobuildpacks/builder-jammy-full --env BP_JVM_VERSION=21 |
We will need to debug this further to see why users are having different results with Podman Desktop and podman-mac-helper, but we've created a wiki page in the Spring Boot GitHub repo to capture some of the items here that can be covered with documentation. See https://github.com/spring-projects/spring-boot/wiki/Building-OCI-Images-with-Spring-Boot#podman-support. Feel free to comment with feedback on this documentation. |
@acisternino There is some information here about testing with the |
Hi @scottfrederick, I have tried using This is what I tried from inside the project (named
|
@scottfrederick is there anything I can do to help with this issue? I created a repo with two samples showing how to reproduce the error: everything works well with Spring Boot 3.1, but it fails on 3.2 and 3.3. https://github.com/ThomasVitale/spring-boot-buildpacks-test When using the pack CLI directly, the build is successful for Spring Boot 3.1, 3.2, and 3.3. So it would seem to be a bug/regression in the Spring Boot plugin introduced in 3.2. |
FWIW: For me
I used the local socket name and left out the |
Problem
gradlew buildBootImage
fails with permission denied when used on macOS Sonoma (14) with podman as a container engine.Steps to reproduce
cd
into it./gradlew bootBuildImage
commandError
More info
Podman is configured to have docker compatibility activated. This is visible in Podman Desktop's dashboard.
These are the sockets and their properties:
Versions:
The text was updated successfully, but these errors were encountered: