admin管理员组文章数量:1300174
I have a Spring Boot 3 project with a H2 database that I want to run in a Docker container, but it doesn't run.
I'm using those commands:
docker build -t spring-hope .
docker run -p 8080:8080 spring-hope
This is the configuration:
application.yml:
spring:
application:
name: hope
datasource:
driver-class-name: .h2.Driver
username: sa
password:
jpa:
database-platform: .hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
properties:
jakarta.persistence.jdbc.url: jdbc:h2:mem:testdb
hibernate.dialect: .hibernate.dialect.H2Dialect
h2:
console:
enabled: true
path: /h2-console
server:
error:
include-message: always
include-binding-errors: always
And it throws this exception: .txt
This is the repository:
What is going on guys?
I have a Spring Boot 3 project with a H2 database that I want to run in a Docker container, but it doesn't run.
I'm using those commands:
docker build -t spring-hope .
docker run -p 8080:8080 spring-hope
This is the configuration:
application.yml:
spring:
application:
name: hope
datasource:
driver-class-name: .h2.Driver
username: sa
password:
jpa:
database-platform: .hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
properties:
jakarta.persistence.jdbc.url: jdbc:h2:mem:testdb
hibernate.dialect: .hibernate.dialect.H2Dialect
h2:
console:
enabled: true
path: /h2-console
server:
error:
include-message: always
include-binding-errors: always
And it throws this exception: https://github/ocardenasmartinez1984/hope/blob/main/error.txt
This is the repository: https://github/ocardenasmartinez1984/hope
What is going on guys?
Share Improve this question edited Feb 11 at 15:20 Octavio Cárdenas asked Feb 11 at 14:09 Octavio CárdenasOctavio Cárdenas 978 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0I cloned your GitHub-repository and changed your application.yml to a minimum, and app starts without errors. Built with ./gradlew clean bootJar
, then ran the Docker-commands.
spring:
application:
name: hope
jpa:
open-in-view: false
hibernate:
ddl-auto: update
h2:
console:
enabled: true
本文标签: Spring Boot 3 doesn39t run in DockerStack Overflow
版权声明:本文标题:Spring Boot 3 doesn't run in Docker - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741658754a2390912.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
git rm
the old error message.) – David Maze Commented Feb 11 at 14:12persistence.xml
, remove thejakarta.persistence.jdbc.url
property, as well as thedriver-class-name
. Add aurl
property tospring.datasource
(or ditch it all together. – M. Deinum Commented Feb 11 at 14:28