blob: 4f5ebaf6a7d50b7b2e7e76b7358c85df36589ba5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
|