Debugging “Temporary failure in name resolution” in Docker containers

I was encountering DNS issues with Docker containers orchestrated by DDEV earlier. Some hosts failed to resolve only within the container for some reason.

To fix it, I changed the following options in the `/etc/default/docker` file:

DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

This helps override the DNS options for Docker containers. Afterwards restart the Docker service:

sudo service docker restart

This solved the problem for me. I found the solution on Stackoverflow.

Fix for WSL2 docker-credential-desktop.exe: Invalid argument

I just ran into a weird error with WSL after moving a workspace around on a different machine and trying to run ddev.

failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: rpc error: code = Unknown desc = error getting credentials - err: exec: “docker-credential-desktop.exe”: executable file not found in $PATH, out: ``

When trying to invoke the “docker-credential-desktop.exe” from WSL (by building a Docker image or trying to run ddev for example) I always got a “Invalid argument” error. After a bit of trying around I found this message on the Docker forums which actually fixed the problem for me.

Edit the ~/.docker/config.json file:

nano ~/.docker/config.json

It should display something similar to this:

{
  "credsStore": "desktop.exe"
}

Change “credsStore” to “credStore” like this:

{
  "credStore": "desktop.exe"
}

I have no idea why this works or why this is a thing, but I would like to preserve this solution here in case it happens to me again or somebody else runs into this same problem.

I was able to run ddev normally afterwards.