diff options
| author | hrbrmstr <bob@rud.is> | 2026-06-10 09:26:45 -0400 |
|---|---|---|
| committer | hrbrmstr <bob@rud.is> | 2026-06-10 09:26:45 -0400 |
| commit | 8d2890e93ff96fc21d6e00fe0a03cf4b1a871271 (patch) | |
| tree | 11382e05b81b7e251c8c59f77c56763032e54053 /2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin | |
| parent | bd417023bfb20a65052611064b6df9e6bf9ad597 (diff) | |
add apple container machine artifacts: two Dockerfiles (recon-machine, ubuntu-systemd-admin) and the apple-container-machine skill
Diffstat (limited to '2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin')
| -rw-r--r-- | 2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin b/2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin new file mode 100644 index 0000000..4f5ebaf --- /dev/null +++ b/2026/apple-container-machine-machines/Dockerfile.ubuntu-systemd-admin @@ -0,0 +1,51 @@ +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 |
