DinD problem with DNS

Hello everyone,

I’m running into a DNS issue while building a devcontainer(VSCODE).

During the build step, I get the following error:

0.228   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
0.228                                  Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: myregistry

What’s confusing is that once the devcontainer is running, I can successfully reach myregistry from inside it. This makes me think the DNS problem only happens during the image build phase, not at runtime.

I’m trying to launch this container from within devcontainer. This setup was working before, but recently I started seeing DNS resolution failures during the build.

Environment details:

Docker version: 29.1.4-1

Build: 0e6fee6c52f761dc79dc4bf712ea9fe4095c9bd2

Has anyone run into a similar issue, or does anyone have suggestions on how to debug or fix DNS resolution during the devcontainer build stage?

Thanks in advance!

What is “myregistry”? Is it the actual domain you use or you just replaced the original one with this to not share that publicly?

Yes, but i found the solution.

Need to add to /etc/docker/daemon.json this: "dns": [xxxxxxxxx].