forked from openhab/openhabian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ubuntu-BATS
60 lines (49 loc) · 1.91 KB
/
Dockerfile.ubuntu-BATS
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
FROM balenalib/amd64-ubuntu:focal-build
# Install Systemd
# Additionally, 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 gnupg acl && \
rm -rf /var/lib/apt/lists/*
ENV container docker
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DOCKER=1
# 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
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
STOPSIGNAL 37
ENTRYPOINT ["/usr/bin/entry.sh"]
RUN git clone https://github.com/bats-core/bats-core.git && \
cd bats-core && \
./install.sh /usr/local
RUN git clone https://github.com/gdraheim/docker-systemctl-replacement
RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
RUN adduser openhabian --gecos "openHABian,,," --disabled-password && \
adduser openhab --gecos "openHABian,,," --disabled-password && \
echo "openhabian:openhabian" | chpasswd && \
echo "openhab:openhabian" | chpasswd
COPY . /opt/openhabian/
COPY build-image/openhabian.conf /etc/openhabian.conf
WORKDIR /opt/openhabian/
RUN apt-get update
COPY docker-tests/start.sh ./
CMD ["bash", "start.sh"]