Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 6bab744

Browse files
committed
Add Dockerfile for ubuntu-disco-systemd (baseline for K8s nodes)
1 parent b01bc1f commit 6bab744

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#
2+
# Ubuntu Disco + Systemd
3+
#
4+
# Description:
5+
#
6+
# This image serves as a basic reference example for user's looking to
7+
# run Systemd inside a system container in order to deploy various
8+
# services within the system container, or use it as a virtual host
9+
# environment.
10+
#
11+
# Usage:
12+
#
13+
# $ docker run --runtime=sysbox-runc -it --rm --name=syscont nestybox/ubuntu-disco-systemd
14+
#
15+
# This will run systemd and prompt for a user login; the default user/password
16+
# in this image is "admin/admin".
17+
18+
FROM ubuntu:disco
19+
20+
#
21+
# Systemd installation
22+
#
23+
RUN apt-get update && \
24+
apt-get install -y --no-install-recommends \
25+
systemd \
26+
systemd-sysv \
27+
libsystemd0 \
28+
ca-certificates \
29+
dbus \
30+
iptables \
31+
iproute2 \
32+
kmod \
33+
locales \
34+
sudo \
35+
udev && \
36+
\
37+
# Prevents journald from reading kernel messages from /dev/kmsg
38+
echo "ReadKMsg=no" >> /etc/systemd/journald.conf && \
39+
\
40+
# Housekeeping
41+
apt-get clean -y && \
42+
rm -rf \
43+
/var/cache/debconf/* \
44+
/var/lib/apt/lists/* \
45+
/var/log/* \
46+
/tmp/* \
47+
/var/tmp/* \
48+
/usr/share/doc/* \
49+
/usr/share/man/* \
50+
/usr/share/local/* && \
51+
\
52+
# Create default 'admin/admin' user
53+
useradd --create-home --shell /bin/bash admin && echo "admin:admin" | chpasswd && adduser admin sudo
54+
55+
# Make use of stopsignal (instead of sigterm) to stop systemd containers.
56+
STOPSIGNAL SIGRTMIN+3
57+
58+
# Set systemd as entrypoint.
59+
ENTRYPOINT [ "/sbin/init" ]

0 commit comments

Comments
 (0)