I am new to Docker.io. I crated image using standard image ubuntu from index.docoker.io successfully in aws instance.I installed node.js and simple web app in the image and created docker container and test successfully with the following: curl -i localhost:49160 in the browser I specified hostip:1704 but I am not getting the page
-
can you post your Dockerfile and command you run the container?Valentin Kantor– Valentin Kantor2014-01-26 19:46:02 +00:00Commented Jan 26, 2014 at 19:46
-
FROM ubuntu:latest MAINTAINER s rambabu RUN apt-get install -y python-software-properties python RUN add-apt-repository ppa:chris-lea/node.js RUN echo "deb us.archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list RUN apt-get update RUN apt-get install -y nodejs #RUN apt-get install -y npm ADD /src /src RUN cd src; npm install EXPOSE 1704 CMD ["node", "/src/index.js"]user3237421– user32374212014-01-26 23:59:48 +00:00Commented Jan 26, 2014 at 23:59
-
The run command I have used is:sudo docker run -p 49160:1704 -d ssit/ssit-node-hello:latestuser3237421– user32374212014-01-27 00:01:07 +00:00Commented Jan 27, 2014 at 0:01
Add a comment
|
1 Answer
It looks like you're using the wrong port to access the application. Try pointing your browser to http://<host_ip>:49160
The application inside the container is exposing the port 1704, and when you run the container with the parameter -p 49160:1704, you're forwarding the port 49160 on your host machine to the port 1704 inside the container. When using the browser to access the app, you use the IP of the host machine and the open port, in this case 49160.
See the Redirect ports documentation for more info.