jib: Spring Boot Application containerizes but Tomcat Server doesn't start

Description of the issue:

  1. Create a Rest service w/ Spring Boot, and add Jib to Maven pom.xml.
  2. Validate that local run, default port 8080 is exposed.
  3. Run `jib:build
  4. Run the created container image
  5. Notice the port isn’t opened. Tomcat didn’t start.

Expected behavior: Created image should behave like the JAR.

Steps to reproduce:

  1. Build application here: https://github.com/saturnism/spring-cloud-gcp-guestbook/tree/master/11-kubernetes/guestbook-frontend
  2. Build container w/ Jib.
  3. Notice the port isn’t opened.

Environment: MacOS, Maven

jib-maven-plugin Configuration:

<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>jib-maven-plugin</artifactId>
  <version>0.9.6</version>
  <configuration>
    <to>
      <image>gcr.io/.../guestbook-frontend</image>
    </to>
  </configuration>
</plugin>

Log output: Normal Startup w/o Jib

2018-07-17 14:09:02.191  INFO [-,,,] 60312 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2018-07-17 14:09:02.485  INFO [-,,,] 60312 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2018-07-17 14:09:02.488  INFO [-,,,] 60312 --- [           main] c.example.frontend.FrontendApplication   : Started FrontendApplication in 9.774 seconds (JVM running for 10.318)

Failed startup w/ Jib

springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2018-07-17 18:05:09.937  INFO [-,,,] 1 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'application-1.errorChannel' has 1 subscriber(s).
2018-07-17 18:05:09.937  INFO [-,,,] 1 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2018-07-17 18:05:09.967  INFO [-,,,] 1 --- [           main] c.example.frontend.FrontendApplication   : Started FrontendApplication in 9.085 seconds (JVM running for 9.892)

Additional Information:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (15 by maintainers)

Most upvoted comments

Ah I found it: @saturnism

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-tomcat</artifactId>
			<scope>provided</scope>
		</dependency>

The scope is set to provided, but should be none/compile.