Skip to content
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
1 change: 1 addition & 0 deletions almalinux-8/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-8/Containerfile-fixed
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-8/Containerfile-vault
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-8/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export LANG=C LC_CTYPE=C

set -x
dnf clean all
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions almalinux-9/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-9/Containerfile-fixed
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-9/Containerfile-vault
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN userdel systemd-oom # remove unused dynamic system user

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions almalinux-9/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export LANG=C LC_CTYPE=C

set -x
dnf clean all
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions debian/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions debian/Containerfile-12.0
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions debian/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ LANG=C
LC_CTYPE=C
export LANG LC_CTYPE
apt-get clean
rm -f /etc/machine-id /var/lib/dbus/machine-id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how I do it on Debian/Ubuntu, there was a reason but I don't recall. This should be tested before pushed. Not sure if my Debian/Ubuntu virtual cluster still works.

echo "uninitialized" > /etc/machine-id && \
rm -v /var/lib/dbus/machine-id

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Booted a Debian:12.0 node and it worked fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the guidance from the manpage:

       For operating system images which are created once and used on multiple
       machines, for example for containers or in the cloud, /etc/machine-id
       should be either missing or an empty file in the generic file system
       image (the difference between the two options is described under "First
       Boot Semantics" below). An ID will be generated during boot and saved
       to this file if possible. Having an empty file in place is useful
       because it allows a temporary file to be bind-mounted over the real
       file, in case the image is used read-only.

It sounds like systemd writes "uninitialized" to the file temporarily during first boot, but I haven't found guidance to do it for images. Unless you can find a reason to do it, I recommend we remove it (or put an empty file there) for our images.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote remove

1 change: 1 addition & 0 deletions examples/rhel-9/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RUN rm -f /etc/systemd/system/systemd-logind.service \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions examples/rhel-9/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ LANG=C
LC_CTYPE=C
export LANG LC_CTYPE
dnf clean all
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions leap/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN zypper update -y \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions leap/Containerfile.15
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN zypper update -y \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions leap/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
export LANG=C LC_CTYPE=C
set -x
zypper clean -a
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions rockylinux-8/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-8/Containerfile-fixed
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-8/Containerfile-vault
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-8/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export LANG=C LC_CTYPE=C

set -x
dnf clean all
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions rockylinux-9/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-9/Containerfile-fixed
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-9/Containerfile-vault
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN chmod u+w / # https://github.com/openhpc/ohpc/issues/2061

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions rockylinux-9/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export LANG=C LC_CTYPE=C

set -x
dnf clean all
rm -f /etc/machine-id /var/lib/dbus/machine-id
1 change: 1 addition & 0 deletions tumbleweed/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ RUN zypper update -y \

COPY excludes /etc/warewulf/
COPY container_exit.sh /etc/warewulf/
RUN /etc/warewulf/container_exit.sh
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script may not have execute permissions after COPY. Consider adding chmod +x /etc/warewulf/container_exit.sh before running it or invoke it explicitly with a shell (sh /etc/warewulf/container_exit.sh).

Suggested change
RUN /etc/warewulf/container_exit.sh
RUN chmod +x /etc/warewulf/container_exit.sh \
&& /etc/warewulf/container_exit.sh

Copilot uses AI. Check for mistakes.

CMD [ "/bin/echo", "-e", \
"This image is intended to be used with the Warewulf cluster management and", \
Expand Down
1 change: 1 addition & 0 deletions tumbleweed/container_exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
export LANG=C LC_CTYPE=C
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a shebang (e.g., #!/usr/bin/env bash) at the top of this script to ensure it's executed with the intended shell when run directly.

Copilot uses AI. Check for mistakes.
set -x
zypper clean -a
rm -f /etc/machine-id /var/lib/dbus/machine-id