Skip to content

Commit e19ff9f

Browse files
committed
[base] Ensure full control over APT sources for Ubuntu
Ubuntu images were occasionally failing to build due to unavailability or slowness of the official Ubuntu security repositories. Although Kolla uses `mirror://` URLs to leverage Ubuntu mirror infrastructure, the original `/etc/apt/sources.list.d/ubuntu.sources` file was still present, causing the system to fallback to default sources. This commit aligns Ubuntu behavior with Debian by explicitly removing the distro `.sources` file and relying solely on the sources configured by Kolla. This ensures consistent and reproducible builds both in CI and on local environments. Closes-Bug: #2112140 Change-Id: I00bcb30662bb12ed8711b28a64ef1941dcce893a (cherry picked from commit b5849ad)
1 parent 941ebde commit e19ff9f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

docker/base/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ RUN cat /tmp/kolla_bashrc >> /etc/bash.bashrc \
249249

250250
{% block base_ubuntu_package_sources_list %}
251251
{% if base_distro == 'debian' or ( base_distro == 'ubuntu' and base_arch == 'x86_64' ) %}
252-
RUN rm -f /etc/apt/sources.list.d/debian.sources
252+
RUN rm -f /etc/apt/sources.list.d/{{ base_distro }}.sources
253253
COPY sources.list.{{ base_distro }} /etc/apt/sources.list
254254
{% else %}
255255
COPY sources.list.{{ base_distro }}.{{ base_arch }} /etc/apt/sources.list

docker/base/sources.list.ubuntu

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
# Default repos
44
deb mirror://mirrors.ubuntu.com/mirrors.txt noble main universe
55
deb mirror://mirrors.ubuntu.com/mirrors.txt noble-updates main universe
6+
deb mirror://mirrors.ubuntu.com/mirrors.txt noble-backports main universe
67
deb mirror://mirrors.ubuntu.com/mirrors.txt noble-security main universe
78

8-
# Backports have a lower priority and must be explicitly installed to be used
9-
deb http://archive.ubuntu.com/ubuntu/ noble-backports main universe
10-
119
# We need to add the repo for the updated packages they provide. The main ones
1210
# are qemu, libvirt, and openvswitch.
1311
deb http://ubuntu-cloud.archive.canonical.com/ubuntu noble-updates/epoxy main
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
Ensures Kolla uses only configured APT mirror on Ubuntu for full source control.
5+
`LP#2112140 <https://launchpad.net/bugs/2112140>`__

0 commit comments

Comments
 (0)