Closed regexhater closed 4 years ago
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:
I think this is because you are not adding tomcat to the image (https://github.com/GoogleContainerTools/jib/issues/640#issuecomment-405729035). Remove the provided
scope and see if it works.
<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? https://github.com/spring-projects/spring-boot/issues/13289 https://github.com/spring-projects/spring-boot/issues/413
Looks like their repackaged JAR always includes provided
-scoped dependencies.
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: