-
Notifications
You must be signed in to change notification settings - Fork 118
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 init not working for Java programming language #7171
Comments
thanks for the detailed report, @NileshGule! it looks like the out of curiosity, do you have an explicit spring boot version defined in your |
hi @lizzthabet, You can find the complete source code in the GitHub repo |
thanks, @NileshGule! this should be fixed in the next release of docker desktop (hopefully out in the next week or so). docker init will try to parse a spring boot version from the |
Thanks @lizzthabet. Glad that my little experimentation with Docker init will provide a better experience for SPring Boot developers in the future. |
Description
I tried using Docker init command for Java
After the Dockerfile and Compose files are created, when I try to run the docker compose up --build command, I get the following error and the container exits
This is caused due to a faulty instruction in the generated Dockerfile
The last line for the ENTRYPOINT instruction is generated as
ENTRYPOINT [ "java", "org.springframework.boot.loader.launch.JarLauncher" ]
This should not contain the launch word and if I update the line as follows it works perfectly fine
ENTRYPOINT [ "java", "org.springframework.boot.loader.JarLauncher" ]
Reproduce
Create a spring Boot project before running Docker init command
select Java as the programming language
Select Java 17 as the version
Specify the port as 8080
Once the 4 files are generated as the output of the docker init command, run the application by executing the command
Docker version
Docker info
Expected behavior
The spring boot application should start on port 8080 and be accessible via http://localhost:8080/greeting endpoint
docker version
Client: Cloud integration: v1.0.35+desktop.10 Version: 25.0.2 API version: 1.44 Go version: go1.21.6 Git commit: 29cf629 Built: Thu Feb 1 00:18:45 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.27.1 (136059) Engine: Version: 25.0 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: fce6e0ca9bc000888de3daa157af14fa41fcd0ff Built: Thu Feb 1 00:15:46 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
48210DFC-C503-4D39-8DF3-FF47F7A9E694/20240205095909
Additional Info
No response
The text was updated successfully, but these errors were encountered: