user20358
user20358

Reputation: 14736

Visual Studio 2019 with Container Orchestrator support not working with docker ip

Environment: VS2019 on Windows 10

  1. I have created a core asp.net project.
  2. Right clicked on the project and added orchestration support.
  3. Selected Docker compose.
  4. Target OS: Linux

With this I ran docker ps and got the following output

enter image description here

  1. I hit F5 in VStudio and the browser opens with https://localhost:32776 and shows the web page

I now run docker inspect 9e1911ce311a and get the following output

enter image description here

Problem:

Since the docker ip here in this case is 172.20.0.3, why does https://172.20.0.3:32776 result in

enter image description here

Upvotes: 0

Views: 929

Answers (1)

Ziaullah Khan
Ziaullah Khan

Reputation: 2246

Short Answer:

Host Machine:

URL: http://localhost:32776/

Inside Docker:

URL: https://172.20.0.3/

docker -it <container id> bash
curl https://172.20.0.3/

Long Answer:

When working on docker there are always 2 networks host machine network docker's own private network docker network ls

For a port mapping --ports <left side>:<right side>

if you are debugging from withing docker container you'll have to use port on the right side of the mappings. If you are accessing from host machine use the one of the left hand side.

Upvotes: 1

Related Questions