-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
79 lines (67 loc) · 1.88 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
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
MAINTAINER Anders Åslund <anders.aslund@teknoir.se>
# Update packages
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
git-core \
cmake \
build-essential \
wget \
curl \
debhelper \
cdbs \
autoconf \
automake \
libtool \
libusb-1.0-0 \
libusb-1.0-0-dev \
pkg-config \
libsystemd-dev \
dh-systemd \
init-system-helpers \
libev-dev \
libsystemd-dev \
systemd \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& apt-get autoremove
RUN curl -o /usr/local/bin/gosu -sSL "https://github.com/tianon/gosu/releases/download/1.12/gosu-amd64" && \
echo "0f25a21cf64e58078057adc78f38705163c1d564a959ff30a891c31917011a54 /usr/local/bin/gosu" | sha256sum -c && \
chmod +x /usr/local/bin/gosu
# and get the source code
WORKDIR /root
RUN git clone https://github.com/knxd/knxd.git --single-branch --branch debian
# knxd requires libpthsem which unfortunately isn't part of Debian
COPY pthsem_2.0.8.tar.gz /root/pthsem_2.0.8.tar.gz
RUN tar xzf pthsem_2.0.8.tar.gz
WORKDIR /root/pthsem-2.0.8
RUN dpkg-buildpackage -b -uc
WORKDIR /root
RUN dpkg -i libpthsem*.deb
# now build+install knxd itself
WORKDIR /root/knxd
RUN dpkg-buildpackage -b -uc
WORKDIR /root
RUN dpkg -i knxd_*.deb knxd-tools_*.deb
# clean up
RUN rm /root/*.deb && \
rm /root/*.changes && \
rm /root/*.tar.gz && \
rm -rf /root/knxd && \
rm -rf /root/pthsem-2.0.8 && \
rm -rf /usr/share/locale/* && \
rm -rf /var/cache/debconf/*-old && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /usr/share/doc/*
ADD config.ini /config.ini
ENV GOSU_NAME docker
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh \
&& sed -i -e 's/\r$//' /entrypoint.sh
COPY cmd.sh /
RUN chmod +x /cmd.sh \
&& sed -i -e 's/\r$//' /cmd.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/cmd.sh"]