windows laptop I have created a
Play application which runs fine if I execute its scripts directly. On the local machine, I access the application using
I have now created a
Docker image of the application and have exposed port
#this docker file copies prod specific files to container, eg logback_prod.xml and application_prod.conf FROM openjdk:8 #ENV APP_NAME myapp #ENV APP_VERSION 1.0-SNAPSHOT ... #entrypoint is deploy/.... EXPOSE 9000 ENTRYPOINT ...
But I can’t access the application on
localhost:9000. I suspect that the image might be running on some other IP created by docker itself.
Am I correct? How can I access my application through the container? I don’t need
Services etc. as I already have that setup on another machine. My specific question is how to access the
docker container directly.
I also tried running the
--network="host" but that doesn’t work either
Based on the suggestions below, I executed the following commands but still can’t access the application.
docker run -p 9000:9000 --env-file env.txt imagename
I see the trace
[debug] a.i.TcpListener - Successfully bound to /0.0.0.0:9000 [info] p.c.s.AkkaHttpServer - Listening for HTTP on /0.0.0.0:9000
docker ps -a shows application is up with port binding
docker inspect shows
Chrome doesn’t work
This site can’t be reached172.17.0.2
netstat -ab on
TCP 0.0.0.0:9000 LAPTOP-788I0GL1:0 LISTENING [com.docker.backend.exe]
Source: Docker Questions