forked from openhab/openhabian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.raspberry-pi2
66 lines (52 loc) · 2.06 KB
/
Dockerfile.raspberry-pi2
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
# assumes at least ARMv71 but not ARMv8 (aarch64) yet
FROM balenalib/raspberry-pi2-debian:buster-build
ENV container docker
ENV INITSYSTEM on
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
# bats tests on a minimal install will require additional packages to run properly:
# - lsb-release (influx, homegear)
# - apt-transport-https (homegear, AdoptOpenJDK)
# - unzip (java)
# those packages would normally be included in our standard install
RUN apt-get update -qq \
&& apt-get install --yes -qq --no-install-recommends systemd systemd-sysv git wget python3 python3-pip apt-utils jq \
lsb-release unzip apt-transport-https \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/bats-core/bats-core.git && \
cd bats-core && \
./install.sh /usr/local
# 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 \
systemd-logind.service \
systemd-remount-fs.service \
getty.target \
graphical.target \
kmod-static-nodes.service
WORKDIR /
COPY docker-tests/entry.sh /usr/bin/entry.sh
COPY docker-tests/resin.service /etc/systemd/system/resin.service
RUN systemctl enable /etc/systemd/system/resin.service
RUN git clone https://github.com/gdraheim/docker-systemctl-replacement
RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
RUN rm -f /sbin/runlevel
COPY includes/runlevel /sbin/runlevel
RUN chmod 755 /sbin/runlevel
ENTRYPOINT ["/usr/bin/entry.sh"]
RUN adduser openhabian --gecos "openHABian,,," --disabled-password
RUN adduser openhab --gecos "openHABian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhab:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch
COPY . /opt/openhabian/
COPY build-image/openhabian.conf /etc/openhabian.conf
WORKDIR /opt/openhabian/
COPY docker-tests/start.sh ./
VOLUME ["/sys/fs/cgroup"]
STOPSIGNAL 37
CMD ["bash", "start.sh"]