-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile_guest
More file actions
23 lines (18 loc) · 858 Bytes
/
Containerfile_guest
File metadata and controls
23 lines (18 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM docker.io/library/ubuntu:26.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
openssh-server \
systemd \
systemd-sysv \
&& rm -rf /var/lib/apt/lists/*
# Root password for SSH access.
RUN echo 'root:root' | chpasswd
# Allow root login via SSH.
RUN sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
# DNS via kernel boot args: the kernel writes nameservers from the ip= boot
# parameter to /proc/net/pnp, so we symlink resolv.conf there.
# We can't rm /etc/resolv.conf during build (Podman bind-mounts it), so we
# use a systemd-tmpfiles rule to create the symlink on first boot.
RUN echo 'L+ /etc/resolv.conf - - - - /proc/net/pnp' > /etc/tmpfiles.d/resolv.conf
# Ensure sshd host keys are generated on first boot.
RUN systemctl enable ssh