spring-projects / spring-projects/spring-boot
Support podman for the Docker Compose feature
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Environment
- OS:
Ubuntu 24.10 - Java:
OpenJDK Runtime Environment GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01) - Podman:
podman version 5.0.3 - Spring boot:
3.4.0
The problem
I have created a very quick demo project using start.spring.io and seeing the same behaviour I am seeing in my project. Error is as follows:
[INFO] --- spring-boot:3.4.0:run (default-cli) @ demo ---
[INFO] Attaching agents: []
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.4.0)
2024-12-07T17:57:33.159+02:00 INFO 190325 --- [demo] [ main] com.example.demo.DemoApplication : Starting DemoApplication using Java 23.0.1 with PID 190325 (/home/philip/Downloads/demo/target/classes started by philip in /home/philip/Downloads/demo)
2024-12-07T17:57:33.162+02:00 INFO 190325 --- [demo] [ main] com.example.demo.DemoApplication : No active profile set, falling back to 1 default profile: "default"
2024-12-07T17:57:33.261+02:00 INFO 190325 --- [demo] [ main] .s.b.d.c.l.DockerComposeLifecycleManager : Using Docker Compose file /home/philip/Downloads/demo/compose.yaml
2024-12-07T17:57:33.656+02:00 ERROR 190325 --- [demo] [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.boot.docker.compose.core.DockerOutputParseException: Failed to parse docker JSON:
at org.springframework.boot.docker.compose.core.DockerJson.deserialize(DockerJson.java:81) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.core.DockerJson.deserialize(DockerJson.java:73) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.core.DockerCli$DockerCommands.getDockerComposeCommand(DockerCli.java:161) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.core.DockerCli$DockerCommands.<init>(DockerCli.java:137) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.core.DockerCli.lambda$new$0(DockerCli.java:63) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1229) ~[na:na]
at org.springframework.boot.docker.compose.core.DockerCli.<init>(DockerCli.java:62) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.core.DockerCompose.get(DockerCompose.java:145) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.lifecycle.DockerComposeLifecycleManager.getDockerCompose(DockerComposeLifecycleManager.java:166) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.lifecycle.DockerComposeLifecycleManager.start(DockerComposeLifecycleManager.java:114) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.lifecycle.DockerComposeListener.onApplicationEvent(DockerComposeListener.java:53) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.boot.docker.compose.lifecycle.DockerComposeListener.onApplicationEvent(DockerComposeListener.java:35) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185) ~[spring-context-6.2.0.jar:6.2.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178) ~[spring-context-6.2.0.jar:6.2.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156) ~[spring-context-6.2.0.jar:6.2.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138) ~[spring-context-6.2.0.jar:6.2.0]
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:98) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplicationRunListeners.lambda$contextLoaded$4(SpringApplicationRunListeners.java:72) ~[spring-boot-3.4.0.jar:3.4.0]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:72) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:416) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361) ~[spring-boot-3.4.0.jar:3.4.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) ~[spring-boot-3.4.0.jar:3.4.0]
at com.example.demo.DemoApplication.main(DemoApplication.java:10) ~[classes/:na]
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[jackson-databind-2.18.1.jar:2.18.1]
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:5008) ~[jackson-databind-2.18.1.jar:2.18.1]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4910) ~[jackson-databind-2.18.1.jar:2.18.1]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3860) ~[jackson-databind-2.18.1.jar:2.18.1]
at org.springframework.boot.docker.compose.core.DockerJson.deserialize(DockerJson.java:78) ~[spring-boot-docker-compose-3.4.0.jar:3.4.0]
... 27 common frames omitted
The docker-compose file looks like:
services:
postgres:
image: 'postgres:latest'
environment:
- 'POSTGRES_DB=mydatabase'
- 'POSTGRES_PASSWORD=secret'
- 'POSTGRES_USER=myuser'
ports:
- '5432'
- Running
docker-compose upfrom the CLI starts it up with no problems - I do have a podman aliasing dependency installed on the system so the normal docker commands work except using podman.
- Using test containers from spring boot works fine.
- Building OCI images works fine.
I'm not keen to switch from podman to docker, tho that is certainly one way to probably resolve this.
Any assistance would be appreciated
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the provided compose.yaml and Podman setup, then start by reading DockerCli and DockerJson, which appear in the stack trace under spring-boot-docker-compose. Trace how DockerComposeLifecycleManager discovers and invokes the compose command; done means the Docker Compose feature starts the services successfully when Podman is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, java, spring-boot
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100