0
votes

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.

1
check the logs docker container logs myTomcat or launch without -d option to see them.Michał Krzywański
@michalk , container logs are good(attached in the post itself).Siyaram Malav
Have you checked this question? I am not familiar with tomcat, but you should ensure that the bind address is not localhost.leopal
@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
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 8080Kevin

1 Answers

0
votes

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.