forked from nestybox/sysbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.systemd.debian
56 lines (51 loc) · 2.63 KB
/
Dockerfile.systemd.debian
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
52
53
54
55
56
ARG sys_arch
FROM sysbox-test-${sys_arch}:latest
#
# Systemd installation
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
systemd \
systemd-sysv \
libsystemd0 \
ca-certificates \
dbus \
iptables \
iproute2 \
kmod \
locales \
sudo \
udev && \
\
# Prevents journald from reading kernel messages from /dev/kmsg
echo "ReadKMsg=no" >> /etc/systemd/journald.conf && \
\
# Disabling getty services to deal with a known-issue that allows
# systemd's getty daemon to hog the host CPU when running inside
# 'privileged' containers.
systemctl mask [email protected] getty-static.service && \
\
# Housekeeping
apt-get clean -y && \
rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/var/log/* \
/tmp/* \
/var/tmp/* \
/usr/share/doc/* \
/usr/share/man/* \
/usr/share/local/* && \
\
# Create default 'admin/admin' user
useradd --create-home --shell /bin/bash admin && echo "admin:admin" | \
chpasswd && adduser admin sudo
# The sysbox installer will look for the linux-headers
RUN apt-get update && apt-get install -y --no-install-recommends \
linux-headers-amd64
# Make use of stopsignal (instead of sigterm) to stop systemd containers.
STOPSIGNAL SIGRTMIN+3
# Allow systemd to identify the virtualization mode to operate on (docker mode).
ENV container docker
# Set systemd as entrypoint.
ENTRYPOINT [ "/sbin/init" ]