2018-06-28 18:26:47 -07:00
|
|
|
# Systemd inside a Docker container, for CI only
|
2023-03-21 10:15:22 +01:00
|
|
|
ARG BASE_IMAGE=ubuntu:20.04
|
|
|
|
|
FROM $BASE_IMAGE
|
2018-06-28 18:26:47 -07:00
|
|
|
|
2021-10-17 05:12:47 +02:00
|
|
|
# DEBIAN_FRONTEND is set to avoid being asked for input and hang during build:
|
|
|
|
|
# https://anonoz.github.io/tech/2020/04/24/docker-build-stuck-tzdata.html
|
2021-10-17 18:36:34 +02:00
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive \
|
2021-10-17 05:12:47 +02:00
|
|
|
&& apt-get update \
|
2021-10-17 03:31:57 +02:00
|
|
|
&& apt-get install --yes \
|
|
|
|
|
systemd \
|
2023-03-24 11:36:36 +01:00
|
|
|
bzip2 \
|
2021-10-17 03:31:57 +02:00
|
|
|
curl \
|
|
|
|
|
git \
|
|
|
|
|
sudo \
|
2023-03-21 11:05:25 +01:00
|
|
|
python3 \
|
2021-10-17 03:31:57 +02:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2018-06-28 18:26:47 -07:00
|
|
|
|
|
|
|
|
# Kill all the things we don't need
|
|
|
|
|
RUN find /etc/systemd/system \
|
|
|
|
|
/lib/systemd/system \
|
|
|
|
|
-path '*.wants/*' \
|
|
|
|
|
-not -name '*journald*' \
|
|
|
|
|
-not -name '*systemd-tmpfiles*' \
|
|
|
|
|
-not -name '*systemd-user-sessions*' \
|
|
|
|
|
-exec rm \{} \;
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p /etc/sudoers.d
|
|
|
|
|
|
|
|
|
|
RUN systemctl set-default multi-user.target
|
|
|
|
|
|
|
|
|
|
STOPSIGNAL SIGRTMIN+3
|
|
|
|
|
|
2020-02-17 16:50:27 +02:00
|
|
|
# Uncomment these lines for a development install
|
2020-02-07 11:42:20 +02:00
|
|
|
#ENV TLJH_BOOTSTRAP_DEV=yes
|
|
|
|
|
#ENV TLJH_BOOTSTRAP_PIP_SPEC=/srv/src
|
2020-02-17 13:09:16 +02:00
|
|
|
#ENV PATH=/opt/tljh/hub/bin:${PATH}
|
2018-06-28 18:26:47 -07:00
|
|
|
|
2021-10-18 02:54:49 +02:00
|
|
|
CMD ["/bin/bash", "-c", "exec /lib/systemd/systemd --log-target=journal 3>&1"]
|