Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

673
Views
Spring Boot app in Docker receives: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

I have a Spring Boot app in Docker that runs on Heroku.

Recently, after updating Tomcat to 10.1.0-M10, I started getting this error:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

The immediate thought of downgrading to lower versions doesn't work due to vulnerabilities in the earlier versions. I have checked possible causes and found Tomcat binding port issue.

I cannot set up fixed config for different ports as I am deploying to Heroku and dependent on their random ports.

My Dockerfile:

FROM azul/zulu-openjdk-alpine:11
ENV PORT=$PORT
COPY /target/app.jar /app.jar
CMD java -Xms256m -Xmx512m \
    -Dlog4j2.formatMsgNoLookups=true \
    -Djava.security.egd=file:/dev/./urandom \
    -Dserver.port=$PORT \
    -jar /app.jar

What is the way to solve it? Is there anything I am missing?

UPDATE:

There are more logs from Heroku:

Feb 22 12:50:16 integration-test app/web.1 2022-02-22 20:50:16.057 [main] INFO  c.g.s.z.ApplicationKt - Started ApplicationKt in 8.09 seconds (JVM running for 9.062)
Feb 22 12:50:16 integration-test app/web.1 2022-02-22 20:50:16.060 [main] DEBUG o.s.b.a.ApplicationAvailabilityBean - Application availability state LivenessState changed to CORRECT
Feb 22 12:50:16 integration-test app/web.1 2022-02-22 20:50:16.063 [main] DEBUG o.s.b.a.ApplicationAvailabilityBean - Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
Feb 22 12:51:06 integration-test heroku/web.1 Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I found a solution that wasn't perfect but seemed to work for me.

  • Downgraded Spring Boot from 2.6.3 to 2.6.1
  • Downgraded Tomcat from 10.X.X to 9.X.X
  • Removed dev tools dependencies

I think the two latest did the magic. Dev tools stopped asking for an extra port in the test/prod environment. Tomcat bound the port in the version 9.X.X but not in 10.X.X.

Even though I found the solution, I don't know why it behaved like this, and it isn't perfect security-wise.

over 4 years ago · Santiago Trujillo Report

0

from the error message it seems that $PORT is not resolved to any environment variable.

deploying to heroku you must use .env file to define env vars (you can't use docker run -e PORT=1234) see documentation

When you use heroku locally, you can set config vars in a .env file. When heroku local is run .env is read and each name/value pair is set in the environment. You can use this same .env file when using Docker: docker run -p 5000:5000 --env-file .env <image-name>

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!