0

I have Java web app in docker container.

Now container is exposed on host's port 8080 from container's port 8080 by running docker run command.

docker run -d -p 8080:8080 --name myTomcat -v $(pwd)/out/artifacts/DockerJavaWebAppWarExploded:/usr/local/tomcat/webapps/ tomcat:latest

enter image description here

There is no other process running on 8080 port ,but i am not able to access the application from browser http://localhost:8080/.

Container logs :

enter image description here

Please help.

It would be appreciated.

Yann
  • 484
  • 1
  • 4
  • 13
Siyaram Malav
  • 4,414
  • 2
  • 31
  • 31
  • check the logs `docker container logs myTomcat` or launch without `-d` option to see them. – Michał Krzywański Jan 08 '20 at 08:09
  • @michalk , container logs are good(attached in the post itself). – Siyaram Malav Jan 08 '20 at 08:16
  • Have you checked [this](https://stackoverflow.com/questions/35414479/docker-ports-are-not-exposed?rq=1) question? I am not familiar with tomcat, but you should ensure that the bind address is not localhost. – leopal Jan 08 '20 at 08:51
  • @SiyaramMalav you attached a PNG file of some sort to the question. You need to include the text output from `docker logs`, not an image and definitely not a screenshot of a terminal window. – David Maze Jan 08 '20 at 11:06
  • Are you sur you can access to your app at 8080 ? (in the container) Try enter in it with `docker exec` and curl at port 8080 – Kevin Jan 08 '20 at 11:26
  • Do you get a 404 error or a connection refused? A 404 error would mean that docker and tomcat are started correctly, but your app is not deployed. – GeertPt Jan 08 '20 at 14:02

1 Answers1

0

Check if http://0.0.0.0:8080 returns values. If yes, you may add an enrty for 0.0.0.0 in your hosts file.