Docker 24.0.7 and dind 24.0.7 unable to update ubuntu images. Temporary failure resolving 'archive.ubuntu.com'

Using the above containers in a gitlab pipeline to build a custom container. Getting the below errors.

Temporary failure resolving 'security.ubuntu.com'
Temporary failure resolving 'archive.ubuntu.com'

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.

In the meantime Im going to check 24.0.7

You’re correct, its actually not a docker hub issue. It’s with the official docker and dind image. Thanks for the fast response BTW!

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

Yeah nslookup looks fine in the containers. It’s just when ubuntu tries to reach some repos. I also checked the resolv.conf file and it looks correct.

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.

I’m going to try and run the docker and dind 25rc now in a build and see if that works.

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.

Same issue with docker:25.0.0-beta.3 docker:25.0.0-beta.3-dind.

[ 3/17] RUN apt-get update -y
#6 40.46 Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
#6 40.46 Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
#6 80.50 Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
#6 81.49 Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
#6 120.5 Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
#6 123.5 Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
#6 160.6 Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
#6 167.6 Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
#6 167.6   Temporary failure resolving 'security.ubuntu.com'

Whats weird is it resolves some just fine.

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.

From my Dockerfile:

FROM ubuntu:22.04

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.

So i rolled back my gitlab runner version just to narrow it down and still having the same error:

on 24.0.7 24.0.7-dind and docker:25.0.0-beta.3 docker:25.0.0-beta.3-dind