GithubHelp home page GithubHelp logo

Comments (6)

scottfrederick avatar scottfrederick commented on April 27, 2024

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 /var/run/docker.sock is enough for the Gradle plugin code to access the podman daemon, as demonstrated by the fact that the builder images are being pulled successfully. Processes inside the builder container also need to access the daemon, and this is the part that is not working for you (the error is coming from the creator process in the builder lifecycle).

Please try configuring the plugin as documented and let us know if that works.

from spring-boot.

ThomasVitale avatar ThomasVitale commented on April 27, 2024

@scottfrederick I experienced the same issue. If I downgrade Spring Boot from 3.2.3 to 3.1.9, the bootBuildImage task completes successfully.

Also, I tried out the same test using Maven instead of Gradle, and the spring-boot:build-image command completes successfully for both 3.2.3 and 3.1.9.

So, it seems to be a problem specific to Spring Boot 3.2.x with Gradle.

from spring-boot.

acisternino avatar acisternino commented on April 27, 2024

Apologies, I completely forgot that section of the manual.
However, even with those changes the result is still an error.

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 /run doesn't exist and this could lead to misunderstandings.

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.

from spring-boot.

acisternino avatar acisternino commented on April 27, 2024

With host set to:

host.set("unix:///var/run/docker.sock")

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

from spring-boot.

acisternino avatar acisternino commented on April 27, 2024

This is interesting.

With host set to:

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

from spring-boot.

acisternino avatar acisternino commented on April 27, 2024

Finally, with host set to:

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

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.