Open ports in VS Code dev containers
01:12 06 Oct 2026

I'm trying dev containers in Visual Studio Code. There's something I don't understand. I'm trying one of the examples: vscode-remote-by-dotnet. Everything installed, the Docker container built and started. I opened a new terminal in VS Code, and in the welcome line it says to me:

vscode ➜ /workspaces/vscode-remote-try-dotnet (main)  

Does this mean that this terminal is running in the container, right? In this terminal I ran:

dotnet run  
info: Microsoft.Hosting.Lifetime\[14\] Now listening on: [http://localhost:5000](http://localhost:5000/)  
info: Microsoft.Hosting.Lifetime\[0\] Application started. Press Ctrl+C to shut down.  
info: Microsoft.Hosting.Lifetime\[0\] Hosting environment: Production  
info: Microsoft.Hosting.Lifetime\[0\] Content root path: /workspaces/vscode-remote-try-dotnet  

now I check (in the host terminal):

PS C:\\Users\\vitaly\> netstat -ano | findstr 5000
TCP 127.0.0.1:5000 0.0  
PS C:\\Users\\vitaly\> tasklist | findstr 28508  
Code.exe 28508 Console 7 126?088 K  

as I understand it, port 5000 is opened by the code.exe process and not by Docker...

docker port 056f6dc9896c

shows nothing at all (056f6dc9896c is the container ID).

Why is that?

advice docker vscode-devcontainer