Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

398
Vistas
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.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda