From 63226f0b684b89b6b5d7c98be1e5671073f79a18 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Tue, 10 Dec 2024 14:46:24 +0200 Subject: [PATCH] Create a truly empy /etc/machine-id (#3066) because `echo` adds a LF (line feed) character and that breaks on Alpine Fixes https://github.com/kairos-io/kairos/issues/3059 Signed-off-by: Dimitris Karakasilis --- images/Dockerfile.kairos | 2 +- images/Dockerfile.kairos-alpine | 2 +- images/Dockerfile.kairos-debian | 2 +- images/Dockerfile.kairos-opensuse | 2 +- images/Dockerfile.kairos-rhel | 2 +- images/Dockerfile.kairos-ubuntu | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/images/Dockerfile.kairos b/images/Dockerfile.kairos index 42a3a9100..6326572a9 100644 --- a/images/Dockerfile.kairos +++ b/images/Dockerfile.kairos @@ -86,7 +86,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \ diff --git a/images/Dockerfile.kairos-alpine b/images/Dockerfile.kairos-alpine index e061d0d3c..ffe66577b 100644 --- a/images/Dockerfile.kairos-alpine +++ b/images/Dockerfile.kairos-alpine @@ -236,7 +236,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \ diff --git a/images/Dockerfile.kairos-debian b/images/Dockerfile.kairos-debian index 785eaa112..51a8bbf9f 100644 --- a/images/Dockerfile.kairos-debian +++ b/images/Dockerfile.kairos-debian @@ -250,7 +250,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \ diff --git a/images/Dockerfile.kairos-opensuse b/images/Dockerfile.kairos-opensuse index 69a18df56..dff1a1df6 100644 --- a/images/Dockerfile.kairos-opensuse +++ b/images/Dockerfile.kairos-opensuse @@ -246,7 +246,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \ diff --git a/images/Dockerfile.kairos-rhel b/images/Dockerfile.kairos-rhel index 17e416acf..fb19a7e58 100644 --- a/images/Dockerfile.kairos-rhel +++ b/images/Dockerfile.kairos-rhel @@ -185,7 +185,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \ diff --git a/images/Dockerfile.kairos-ubuntu b/images/Dockerfile.kairos-ubuntu index ad85180bc..5b14f52a1 100644 --- a/images/Dockerfile.kairos-ubuntu +++ b/images/Dockerfile.kairos-ubuntu @@ -463,7 +463,7 @@ RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}" # 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 +RUN printf "" > /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 \