Should you encounter something like this during Docker build.
#6 7.438 Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
#6 7.438 Temporary failure resolving 'archive.ubuntu.com'
#6 7.438 Err:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
#6 7.438 Temporary failure resolving 'security.ubuntu.com'
#6 7.438 Err:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
#6 7.438 Temporary failure resolving 'archive.ubuntu.com'
#6 7.439 Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
#6 7.439 Temporary failure resolving 'archive.ubuntu.com'
#6 7.441 Reading package lists...
#6 7.446 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.ubuntu.com'
#6 7.446 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
Based on this answer, manually set your DNS settings for Docker. Not these settings are for the Docker machine docker, so probably your bare metal machine. https://stackoverflow.com/a/44184773
/etc/docker/daemon.json
{
"log-driver": "local",
"dns": ["8.8.8.8"]
}