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

387
Views
Can't reach localhost:8080 while running docker image

I have developed a small Java demo web app, using gradle, which I want to dockerize with WildFly. I have followed instructions from here.

The Dockerfile is:

FROM jboss/wildfly
MAINTAINER Me <me@qmail.com>

RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#70365 --silent

ADD build/libs/my-demo.war /opt/jboss/wildfly/standalone/deployments/

When I start the image with Docker and browse localhost:8080 or localhost:9990, I get a This site can’t be reached.

Yet, my application runs successfully on localhost:8080 when I use gradle appRun.

What is missing?

I am under Windows 10 Home Edition. I have tried on another laptop under Ubuntu 16 and face the same issue.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Three things:

1st the base image EXPOSEs only port 8080, so to be able to access port 9990 you need to add EXPOSE 9990 to your Dockerfile or --expose 9990 to your docker runcall.

2nd You didn't post your cmd line call, so I can only guess but you need to map the container port to a host port, example (including the additional exposed port)

docker run --expose 9990 -p 9990:9990 -p 8080:8080 -it my-demo

3rd If your working with docker-machine as it is still the case with Win 10 home as far as I recall, you won't have your application on localhost but at the IP of the docker-machine VM. You can find out which IP that is by calling

docker-machine ip

On linux you will have your app on localhost:PORT once you add the port mapping.

about 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!