-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Spring Boot image built with jib maven exits immediately or keeps reloading in kubernetes without any error log #2684
Comments
Can you show us the Dockerfile you were using previously? |
My dockerfile for main-rest. FROM maven:3.6.3-jdk-11 AS build-env
COPY ./pom.xml ./pom.xml
RUN mvn dependency:go-offline -B
COPY ./src ./src
RUN mvn package
FROM gcr.io/distroless/java:11
COPY --from=build-env /target /app
WORKDIR /app
EXPOSE 8080
CMD ["testapp-0.0.1-SNAPSHOT.jar"] I also tried with different images for second stage to check if the problem was with distroless. All executed correctly. |
Could this be #2336? |
I don't know if the issue above relates to mine as i don't include dev-tools in my pom.xml dependencies |
Is there a way to change the logging level to debug? |
To add more context here are my dependencies and plugins <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>9.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.1-jre</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-data-rest</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<to>
<image>docker.io/john32/main-rest</image>
</to>
</configuration>
</plugin>
</plugins>
</build> As for logging level i don't know how to change it |
Can you try running again with the log level set to debug: |
debug log
|
I think this is because you are not adding tomcat to the image (#640 (comment)). Remove the <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
- <scope>provided</scope>
</dependency> |
Removing scope from tomcat fixed the issue. Thanks for help @chanseokoh @loosebazooka |
Strange that it works with docker though? Oh the springboot plugin adds in the server somehow? |
I don't get it either. |
Can't confirm, but maybe this? Looks like their repackaged JAR always includes |
Environment:
Description of the issue:
Pods with docker image build using jib maven plugins keep reloading without displaying any error message. Pod is reloading constantly as displayed in output log
Expected behavior:
Deployed pod with image build with jib should behave just like image build with dockerfile. Either display error log or run once and stop reloading.
Steps to reproduce:
jib-maven-plugin
Configuration:Log output:
Additional Information:
The text was updated successfully, but these errors were encountered: