0

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

3
  • can you post your Dockerfile and command you run the container? Commented 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"] Commented Jan 26, 2014 at 23:59
  • The run command I have used is:sudo docker run -p 49160:1704 -d ssit/ssit-node-hello:latest Commented Jan 27, 2014 at 0:01

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.