Docker Community Forums

Share and learn in the Docker community.

Spring Boot embedded tomcat fails with port already in use error running a Docker image


(Psankaramanchi) #1

Expected behavior

Spring boot embedded tomcat was expected to start with the mentioned port.

Actual behavior

Spring boot embedded tomcat fails with port error -
The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Additional Information

Tried multiple ways of creating an image with/without volume for configuring application properties but still see the same issue with tomcat connector failing to listen on the port 8080

Steps to reproduce the behavior

1 Create a dockerfile with Spring boot application war and application.properties and expose the port
2 Build and push the docker image
3 Run the docker image