When I roll back to docker and dind 24.0.6 everything works fine.
Tried ubuntu 22.04, 23.04 and 24.04. Getting the same above errors on those 3 versions.
If it is a GitLab pipeline, can you clarify why you think it is a Docker Hub issue? If it is about the official dind docker image, we can still discuss it, but then it is not a Docker Hub issue.
Okay, I moved to topic to general discussion. I also tried the dind image with Docker 24.0.7 on my MacBook and the name resolution worked, I could run apt update in ab ubuntu container I ran inside the dind container. The fact that 24.0.6 works for you and 24.0.7 doesn’t is something I can’t explain. Maybe it is something that works usually but not in a GitLab pipeline. Have you tried running some debug commands in the container to find out what the IP address of the container is, what the DNS server is and whether the name resolution works with for example a command like this where you specify the dns server too?
nslookup security.ubuntu.com 8.8.8.8
In order to have nslookup, you could use the nicolaka/netshoot image instead of ubuntu. Or any image you know that contains nslookup, but the netshoot image contains all the tools you would likely need
Another note I’m running my 4 gitlab runners as containers on two local vms. I ran the docker build on the host docker systems and resolved the ubuntu update fine. It’s only when I use 24.0.7 docker and dind on those systems. I run the docker build on my mac and worked fine as well. I’m also using the latest gitlab runner versions.
There is at least one difference between the two images. 24.0.7 is based on Alpine 3.19 and 24.0.6 is based on Alpine 3.18, but I still don’t know why that would matter.
I edited your post to use code blocks so you will not end up being blocked by the spam filter for sharing too many links. Please, follow this guide to use code blocks: How to format your forum posts
Regarding the error message, I’m not sure we interpret it correctly. I tried to change the name server to a non-existing ip address and I got the “Ign” lines, although slowly, and then I got the error messages. In my case, multiple messages.
What I noticed is that in your outputs you have ubuntu.com, but in mine it is http://ports.ubuntu.com/ubuntu-ports
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Err:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy/InRelease Temporary failure resolving 'ports.ubun
tu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
It shouldn’t be different. Are you sure the Ubuntu image you are using is the official image or it is provided by GitLab?
Update:
On second thought, it could be different if GitLab just changes the repo urls for performance or security reasons.
I learned something today… I haven’t checked why, but it looks like the repository url automaically depends on where I start the container. I tried it on a server in a different country, and I got the same URLs as you.