Wednesday, October 23, 2019

Sitecore Docker Setup; "curl: (6) Could not resolve host"

Given the general Docker hype and the clear signals that as an industry containerization adoption will continue becoming more widespread, I decided to take Docker for another spin after several years ignoring it completely and begin fiddling with Sitecore Docker Images.

Sticking closely to the quick start guide on the community-driven Sitecore Docker Images repository - I ran into one snag:

curl: (6) Could not resolve host:
curl: (6) Could not resolve host:
curl: (6) Could not resolve host:
curl: (6) Could not resolve host:

The \docker-images\windows\9.0.2\sitecore-assets\Dockerfile itself only confirmed that a simple curl command initializes the download process from several hard-coded sources:

After some Googling, I found a post - Fix Docker's networking DNS config -by @nottrobin which outlined a similar error.

The key takeaway: this happens "usually because DNS lookups are failing in Docker images".

Their recommendation is to "change the DNS settings of the Docker daemon" by adding a new configuration file to /etc/docker/daemon.json - which I couldn't find.  Given that I'm using a Windows 10 machine and @nottrobin was using Linux, my guess is that there are path differences here. 

I ended up modifying the following file:

And adding a new "dns" parameter (pointing to Google's public DNS)

After saving and restarting Docker, the 'Could not resolve host' error no longer killed the build process. 🥳


  1. I had a similar error message when trying to attach the VS debugger to the docker image. I was connected to an unrelated vpn, and when I disconnected from the vpn and restarted the docker image, the dns worked on the docker image.

  2. Hi, I tried changing the DNS and restarted Docker, but I still run into the same issue. Any help would be appreciated.