No Internet in Dev Container When Specifying Network name
- VSCode Version: 1.67.2
- Local OS Version: Windows 10 21H2 Build 19044.1708, running WSL v2 Ubuntu 20.04
- Local chip architecture: x86
- Reproduces in: Remote - Containers
- Name of Dev Container Definition with Issue: Docker for Docker Compose
Steps to Reproduce:
- Setup new dev container using the Docker for Docker Compose definition
- In the
docker-compose.ymlfor the dev container add this to theappservice:
networks:
- my-network
and add this at the bottom of the file:
networks:
my-network
name: my-network
driver: bridge
(for reference this is done so that later when I spin up my app with docker-compose I can attach it to the same network using the external configuration which allows port forwards to work correctly within my WSL instance)
3. start up the dev container
4. within the dev container from bash run curl google.com
5. returns could not resolve hostname
6. if you comment out the name config above and run everything again you get a valid response
@chrmarti any thoughts?
This should work. Maybe my-network already exists and has some custom configuration preventing it from connecting to the outside?