-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (61 loc) · 1.7 KB
/
Dockerfile
File metadata and controls
73 lines (61 loc) · 1.7 KB
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
FROM alpine:3.12
MAINTAINER orrpan
ARG gitbranch=master
WORKDIR /build
RUN apk --update add \
git \
cmake \
g++ \
make \
linux-headers \
libpcap-dev \
mbedtls-dev \
lua5.1-dev \
luajit-dev \
libexecinfo-dev \
bsd-compat-headers \
openssl
RUN git clone https://github.com/wiringX/wiringX.git
RUN git clone --depth 5 -b ${gitbranch} https://www.github.com/pilight/pilight.git
WORKDIR /build/wiringX
RUN sed -i 's/__time_t/time_t/g; s/__suseconds_t/suseconds_t/g' src/wiringx.c \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make --quiet \
&& make install
WORKDIR /build/pilight
RUN sed -i 's/__time_t/time_t/g; s/__suseconds_t/suseconds_t/g' libs/pilight/core/arp.c \
&& sed -i 's/#include <luajit-2.0/#include <luajit-2.1/g' libs/pilight/lua_c/lua.h \
&& ln -s /usr/lib/liblua.so /usr/lib/liblua5.1.so \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make --quiet \
&& make install
WORKDIR /build/pilight_pem
RUN openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout pilight.key -out pilight.crt -subj "/CN=pilight.org" -days 3650 \
&& cat pilight.key pilight.crt > /etc/pilight/pilight.pem
WORKDIR /
RUN rm -rf /build
RUN apk --purge del \
git \
cmake \
g++ \
make \
linux-headers \
libpcap-dev \
mbedtls-dev \
lua5.1-dev \
luajit-dev \
libexecinfo-dev \
bsd-compat-headers \
openssl
RUN apk --update add \
mbedtls \
lua5.1-libs \
luajit \
libpcap
VOLUME /etc/pilight
EXPOSE 5001
CMD ["/usr/local/sbin/pilight-daemon", "--foreground", "--config", "/etc/pilight/config.json" ]