To stop automatic generation of this file, add the following entry to /etc/wsl.conf:Ĭontainer that uses the custom bridge network (works): cat /etc/nf # This file was automatically generated by WSL. The nf file in the container with the custom bridge network is different and has the docker dns server ip (127.0.0.11).Ĭontainer that uses the default bridge network (doesn't work): cat /etc/nf It seems I found the cause, the nf file inside the container that uses the default bridge network is the same as the one in the host (WSL2), and probably because of that it doesn't work.
#DOCKER NETWORK RM UPDATE#
I don't think it's one of the different options returned by docker network inspect bridge (compared to the other bridge network), tough, because I just tried to run docker run -rm -it ubuntu in a VirtualBox VM (using Vagrant) with Ubuntu 20.04 and then apt update inside the container worked, and in the VM the result and options of docker network inspect bridge are exactly the same than the one in WSL2 (except the id and creation date). My guess is that is some of the options above that are different than the other bridge networks, or maybe some firewall rule that is blocking the docker0 subnet (or gateway). Is there a (non-hackish) way to solve this issue? (without changing the host dns resolution or something similar, because the host dns resolution works, as well non-default bridge networks, so changing the contianer DNS resolution should not be needed what I want is to make the default bridge network behave like the others regarding dns resolution) WARNING: No blkio throttle.write_iops_device support WARNING: No blkio throttle.read_iops_device support WARNING: No blkio throttle.write_bps_device support WARNING: No blkio throttle.read_bps_device support Kernel Version: 4.19.104-microsoft-standard Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Network: bridge host ipvlan macvlan null overlay ".name": "docker0",Īnd the following is the output after inspecting the newly created bridge network (testnet): [ The following is the output after inspecting the default bridge network (docker0): [ I uninstalled docker, removed the /var/lib/docker folder, disabled and removed the docker0 network (that is created again when running docker) to no avail. # works fine (testnet is a newly created bridge network) It also works if I create another bridge network and use it instead of the default bridge network: host$ docker run -rm -it -network testnet ubuntu The command works on the host, as well as running the ubuntu container with the host network. If I run docker run -rm -it ubuntu (or the equivalent docker run -rm -it -network bridge ubuntu) and try to run apt update, for example, it gives errors like Temporary failure resolving ''. I'm using ubuntu 20.04 running in WSL2 and docker had been running fine for months, but recently the containers can't connect to the internet when using the default bridge network (docker0).