D
D
demnagel2019-07-01 14:51:11
Django
demnagel, 2019-07-01 14:51:11

How to find out the address where the container is available in windows?

I'm just trying to work with Docker - don't kick too much and thanks in advance to those who responded!
I use docker toolbox on windows 7
There are two images:
1) pg - database (Postgre);
2) app - debian with a django application, the image of which is built from dockerFile - at the end of which the dev server is launched

CMD ["python","./vfnd/manage.py","runserver", "0.0.0.0:8001"])

I create/run containers as follows
docker run -d --name pg_1 pg
docker run -d -p 8001:8001 --link pg_1 --name app_1 app

I check through ps - containers are running:
app_1 PORT 0.0.0.0:8001->8001;
pg_1 PORT 5432
If you run app_1 with the -it flag, then you can see the print - django dev server is running at 0.0.0.0:8001
On linux django, the application will become available at 127.0.0.1:8001
But on windows with localhost, the situation is different and it is recommended to execute the command that will return the address of the container
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" app_1

But it returns "no value".
Simply inspect outputs the following:
5d19ec541f528063566084.jpeg
Tried to go to 172.17.0.3:8001 (from Networks -> IPAddress) but the page was not found.
What am I doing wrong? How to find out at what address a container is available?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
demnagel, 2019-07-01
@demnagel

You need to find out the address under which the docker is launched
and add the forwarded port

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question