heroku / base-images

Recipes for building the base images for Heroku's stacks
BSD 3-Clause "New" or "Revised" License
267 stars 75 forks source link

Heroku-24: Fix customisation of APT sources list #287

Closed edmorley closed 5 months ago

edmorley commented 5 months ago

Previously the hardcoded custom APT sources list caused APT to pull indexes for both AMD64 and ARM64, even though only one or the other is ever required.

Now, we instead make edits to the existing architecture-specific default Ubuntu APT sources file (which only includes the config for that architecture, not several architectures). This saves having to hardcode multiple variants of the file in setup.sh.

The new implementation intentionally doesn't disable the backports suite (and instead only disables the multiverse and restricted repositories), since Ubuntu no longer considers that suite by default, starting in Ubuntu 11.04: https://help.ubuntu.com/community/UbuntuBackports?action=recall&rev=90

Fixes #286. GUS-W-15576471.

edmorley commented 5 months ago

After this change...

On ARM64:

$ dr --platform=linux/arm64 heroku/heroku:24 cat /etc/apt/sources.list.d/ubuntu.sources | rg -v '^#'

Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports
Components: main universe  
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main universe  
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

And on AMD64:

$ dr --platform=linux/amd64 heroku/heroku:24 cat /etc/apt/sources.list.d/ubuntu.sources | rg -v '^#'

Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main universe  
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main universe  
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg