Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

391
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda