Docker build fails during ‘apt-get install’ with 404 errors

While running ‘docker build’ for a new image using ubuntu:22.04 as the base, running apt-get install for certain packages is giving random 404s on some package dependencies.

For example:

#7 7.691 Err:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 libpython3.10-minimal arm64 3.10.12-1~22.04.5
#7 7.691 404 Not Found [IP: 185.125.190.36 80]

If I run ubuntu:22.04 and then run the ‘apt-get install’ steps manually, they run as expected.

This post here has some tips that previously cached layers when building the image may be causing this, and to run ‘docker build –no-cache’ to avoid using the previously cached layers. Fixed!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.