Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Empty machine-id instead of removing it #2784

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -105,7 +111,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -256,7 +262,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos-debian
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -269,7 +275,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos-opensuse
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -265,7 +271,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos-rhel
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -204,7 +210,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
7 changes: 6 additions & 1 deletion images/Dockerfile.kairos-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ RUN luet database get-all-installed --output /etc/kairos/versions.yaml

# TODO what about caches?
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"

# Set empty machine-id
# This prevents systemd from thinking that the machine is on first boot
# and recreating /etc/ dependencies in services and such
# do this before initramfs so its in the initramfs
RUN echo "" > /etc/machine-id || true
# Regenerate initrd if necessary, proper config files with immucore and custom initrd should already be in there installed by framework
# for systemd distros
RUN if [ -f "/usr/bin/dracut" ]; then \
Expand All @@ -470,7 +476,6 @@ RUN kernel=$(ls /boot/Image* 2>/dev/null | head -n1) && if [ -e "$kernel" ]; the
# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

RUN rm /etc/machine-id || true
RUN rm /var/lib/dbus/machine-id || true
RUN rm /etc/hostname || true

Expand Down
Loading