FROM ubuntu:24.04 ENV container container # Base system + networking RUN apt-get update && \ apt-get install -y \ dbus systemd openssh-server \ curl ca-certificates \ sudo iproute2 iputils-ping net-tools \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Systemd admin tooling RUN apt-get update && \ apt-get install -y \ systemd-container \ tmux \ fzf \ jq \ ripgrep \ bash-completion \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Init setup for container machine RUN >/etc/machine-id && >/var/lib/dbus/machine-id RUN systemctl set-default multi-user.target && \ systemctl mask \ dev-hugepages.mount \ sys-fs-fuse-connections.mount \ systemd-update-utmp.service \ systemd-tmpfiles-setup.service \ console-getty.service && \ systemctl disable \ networkd-dispatcher.service # SSH config for remote access RUN sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ sed -i 's/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config # Admin directory structure RUN mkdir -p /etc/systemd-admin /etc/skel/.ssh/controlmasters # SSH client config template for new users (applies to host user via home mount) COPY ssh_config /etc/skel/.ssh/config RUN chmod 600 /etc/skel/.ssh/config # Copy hosts file and profile helpers COPY hosts /etc/systemd-admin/hosts COPY systemd-admin.sh /etc/profile.d/systemd-admin.sh RUN chmod 644 /etc/systemd-admin/hosts /etc/profile.d/systemd-admin.sh