/
Dockerfile.template
42 lines (33 loc) · 1003 Bytes
/
Dockerfile.template
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
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian
#################
# Install Systemd
#################
ENV container docker
RUN apt-get update && apt-get install -y --no-install-recommends \
systemd-sysv \
&& rm -rf /var/lib/apt/lists/*
# We never want these to run in a container
# Feel free to edit the list but this is the one we used
RUN systemctl mask \
dev-hugepages.mount \
sys-fs-fuse-connections.mount \
sys-kernel-config.mount \
display-manager.service \
getty@.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"]
ENV INITSYSTEM on
######################
# Finish setup systemd
######################
# Setting up the user application
WORKDIR /usr/src/app
COPY start.sh ./
CMD ["bash", "start.sh"]