diff --git a/images/debian12/Dockerfile b/images/debian12/Dockerfile new file mode 100644 index 0000000..1858818 --- /dev/null +++ b/images/debian12/Dockerfile @@ -0,0 +1,48 @@ +FROM debian:bookworm + +ENV container docker + +# Don't start any optional services except for the few we need. +RUN find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ + -not -name '*journald*' \ + -not -name '*systemd-tmpfiles*' \ + -not -name '*systemd-user-sessions*' \ + -exec rm \{} \; + +RUN apt-get update && \ + apt-get install -y \ + dbus systemd openssh-server net-tools iproute2 iputils-ping curl wget vim-tiny sudo && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Truncate machine ID files to trigger regeneration. +RUN >/etc/machine-id +RUN >/var/lib/dbus/machine-id + +EXPOSE 22 + +RUN systemctl set-default multi-user.target +RUN systemctl mask \ + dev-hugepages.mount \ + sys-fs-fuse-connections.mount \ + systemd-update-utmp.service \ + systemd-tmpfiles-setup.service \ + console-getty.service +RUN systemctl disable \ + networkd-dispatcher.service + +# This container image doesn't have locales installed. Disable forwarding the +# user locale env variables or we get warnings such as: +# bash: warning: setlocale: LC_ALL: cannot change locale +RUN sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config + +# This may be needed for some systemd services to start properly. +RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d + +# https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ +STOPSIGNAL SIGRTMIN+3 + +CMD ["/bin/bash"] +