-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
67 lines (52 loc) · 2.13 KB
/
Dockerfile
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
57
58
59
60
61
62
63
64
65
66
# Some parts of code originated from https://github.com/j8r/dockerfiles/
# Debian image with systemd enabled
#FROM jrei/systemd-debian:12
FROM balenalib/raspberrypi3-debian:latest
ENV container docker
RUN apt-get update && apt-get install -y --no-install-recommends \
dbus \
libnss-mdns \
systemd \
&& rm -rf /var/lib/apt/lists/*
RUN systemctl mask \
dev-hugepages.mount \
sys-fs-fuse-connections.mount \
sys-kernel-config.mount \
display-manager.service \
systemd-logind.service \
systemd-remount-fs.service \
getty.target \
graphical.target
COPY systemd/entry.sh /usr/bin/entry.sh
COPY systemd/balena.service /etc/systemd/system/balena.service
RUN systemctl enable /etc/systemd/system/balena.service
STOPSIGNAL 37
ENTRYPOINT ["/usr/bin/entry.sh"]
VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y systemd systemd-sysv sudo wget procps curl systemd iproute2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN cd /lib/systemd/system/sysinit.target.wants/ \
&& rm $(ls | grep -v systemd-tmpfiles-setup)
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/basic.target.wants/* \
/lib/systemd/system/anaconda.target.wants/* \
/lib/systemd/system/plymouth* \
/lib/systemd/system/systemd-update-utmp*
VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]
RUN curl -sL https://install.raspap.com | bash -s -- --yes --wireguard 1 --openvpn 1 --adblock 1
COPY firewall-rules.sh /home/firewall-rules.sh
COPY wpa_supplicant.conf /etc/wpa_supplicant/
RUN chmod +x /home/firewall-rules.sh
COPY env-setup.sh /home/env-setup.sh
RUN chmod +x /home/env-setup.sh
COPY password-generator.php /home/password-generator.php
CMD [ "/bin/bash", "-c", "/home/env-setup.sh && /home/firewall-rules.sh && /lib/systemd/systemd" ]