Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSL2 Dockerfile not building - DNS problems

I´m using WSL2 on Windows with Ubuntu, I had problems with PIP, it gave me DNS problems, so I modified the file /ect/resolve.conf , after this I was able to use PIP, but still I have problems with the Dockerfile.

when using docker build, and trying to use pip install requirements.txt, it tries to download the packages from the requirements file and got DNS problems.

so, how can I add DNS servernames to the Dockerfile? or how can I solve this issue?

Regards.

like image 830
Luis Molina Avatar asked Nov 18 '25 18:11

Luis Molina


1 Answers

I have a similar issue, some domains can't be resolved during docker build. Here is the content of the /etc/resolv.conf from one of my built images:

  • cat /etc/resolv.conf
# DNS requests are forwarded to the host. DHCP DNS options are ignored.
nameserver 192.168.65.7

I couldn't find this IP either in my Windows 10 or in my Ubuntu WSL2 :o

like image 85
Vab Avatar answered Nov 21 '25 08:11

Vab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!