diff options
| author | Will Szumski <will@stackhpc.com> | 2026-11-30 10:38:51 +0000 |
|---|---|---|
| committer | Will Szumski <will@stackhpc.com> | 2026-12-01 11:03:18 +0000 |
| commit | 8d9fb2c449290ed50cec122ed08310cff802091a (patch) | |
| tree | 604c731b8bfcf8dd5234a23cb8c28f113de68762 /kolla/docker/base/Dockerfile.j2 | |
| parent | 73e6c42a3a8011b9584491637061ec757c89baea (diff) | |
| download | kolla-8d9fb2c449290ed50cec122ed08310cff802091a.tar.gz kolla-8d9fb2c449290ed50cec122ed08310cff802091a.zip | |
base: Keep an empty /etc/machine-id
Removing /etc/machine-id makes systemd treat every container start
as first boot, and enable all units according to presets. This
starts firewalld in the bifrost container on Rocky Linux, which runs
with host networking and blocks DHCP to dnsmasq, so inspection fails.
Truncate the file instead. systemd then uses a transient ID, so
containers still do not share a machine ID, without first boot
semantics.
Closes-Bug: #2178419
Generated-By: Claude Code claude-opus-5-5
Change-Id: I1da7fd42f29c8d90c959dd9ed1a6c27621246c18
Signed-off-by: Will Szumski <will@stackhpc.com>
Diffstat (limited to 'kolla/docker/base/Dockerfile.j2')
| -rw-r--r-- | kolla/docker/base/Dockerfile.j2 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kolla/docker/base/Dockerfile.j2 b/kolla/docker/base/Dockerfile.j2 index 731aaaf60..660da3bdb 100644 --- a/kolla/docker/base/Dockerfile.j2 +++ b/kolla/docker/base/Dockerfile.j2 @@ -151,9 +151,12 @@ RUN {{ macros.install_packages(base_rocky_yum_repo_packages | customizable("rock # Install base packages {{ macros.enable_extra_repos(['epel']) }} {# NOTE(mnasiadka): systemd (pulled in by lvm2 and iscsi-initiator-utils) creates - /etc/machine-id, which must not be shared by all containers. #} + /etc/machine-id, which must not be shared by all containers. + NOTE(wszumski): Leave an empty file rather than removing it. systemd treats + a missing /etc/machine-id as first boot and enables all units according to + presets, e.g. firewalld in bifrost. An empty file gets a transient ID. #} {{ macros.install_packages(base_rocky_packages | customizable("rocky_packages")) }} \ - && rm -f /etc/machine-id + && truncate -s 0 /etc/machine-id {# endif for base_package_type rpm #} {% elif base_package_type == 'deb' %} @@ -298,8 +301,9 @@ RUN apt-get --error-on=any update \ && apt-get -y dist-upgrade \ && {{ macros.install_packages(base_apt_packages | customizable('apt_packages'), True) }} \ {#- NOTE(mnasiadka): systemd creates /etc/machine-id, which must not be - shared by all containers. #} - && rm -f /etc/machine-id \ + shared by all containers. Leave an empty file, as a missing one + triggers first boot presets. #} + && truncate -s 0 /etc/machine-id \ # NOTE: python3-pip installs dependent tzdata package and blocks mount in docker - 2091161 && unlink /etc/localtime |
