Can't connect to server running inside docker container (Docker for mac)

Viewed 3565

I have a docker container running on my system which i started using this command:

docker run -it  -v ~/some/dir -p 8000:80  3cce3211b735 bash

Now docker ps lists this:

    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                             NAMES
44de7549d38e        3cce3211b735        "bash"              14 minutes ago      Up 14 minutes       22/tcp, 443/tcp, 8082/tcp, 0.0.0.0:8000->80/tcp   hardcore_engelbart

Inside the container i run my django app using the command : python manage.py runserver 80

But i am not able to view the page using either of these:

1.localhost:8000

2.127.0.0.1:8000

I do understand that my 8000 port is mapped to 80 port on the container. But why am i not able to access it. I am using docker for mac not docker toolbox. Please help and comment if you need any more info.

1 Answers
Related