This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·68 lines (54 loc) · 2.2 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
## Dockerfile for a homebridgesetup on Raspberry-Pi that is able to interact with GPIOs
#the base image
FROM resin/rpi-raspbian:stretch
MAINTAINER Kim Diallo <[email protected]>
#Do the needed apt-get foo
RUN apt-get update
RUN apt-get -y install -f --no-install-recommends \
git \
wget \
build-essential \
python \
nfs-common
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get clean
#Get, build and link pigpio
RUN wget abyz.me.uk/rpi/pigpio/pigpio.tar \
&& tar xf pigpio.tar \
&& cd PIGPIO \
&& make \
&& make install
RUN rm -rf pigpio.tar PIGPIO
#Get, build and link nodejs
ARG VERSION="v8.16.0"
RUN wget https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-armv7l.tar.gz \
&& tar -zxvf node-${VERSION}-linux-armv7l.tar.gz -C /opt \
&& echo "export PATH=/opt/node-${VERSION}-linux-armv7l/bin:$PATH" >> /root/.bashrc \
&& rm -rf /node-${VERSION}-linux-armv7l.tar.gz
ENV PATH="/opt/node-${VERSION}-linux-armv7l/bin:$PATH"
#Get, build and link the needed gits
# We use the GPIO access library http://wiringpi.com/ to interact with the GPIOS
RUN cd /opt/ \
&& git clone git://git.drogon.net/wiringPi \
&& cd wiringPi \
&& ./build
# And https://github.com/xkonni/raspberry-remote to communicate simple in a simple way with a 433 Mhz transmitter.
RUN cd /opt/ \
&& git clone https://github.com/xkonni/raspberry-remote.git \
&& cd raspberry-remote \
&& make send \
&& rm -rf webinterface \
&& ln -s /opt/raspberry-remote/send /usr/local/bin/send
# Install Homebridge and needed plugins
RUN npm i -g --upgrade npm@latest
RUN npm i -g --unsafe-perm homebridge
RUN npm i -g --unsafe-perm homebridge-dht \
&& ln -s /opt/node-${VERSION}-linux-armv7l/lib/node_modules/homebridge-dht/dht22 /usr/local/bin/dht22
RUN npm i -g --unsafe-perm homebridge-gpio-device
RUN npm i -g --unsafe-perm homebridge-broadlink-rm
RUN npm i -g --unsafe-perm homebridge-platform-maxcube
RUN npm i -g --unsafe-perm homebridge-script2
# Add a wrapper-script to run pigpiod and homebridge in one contaier
COPY ./wrapper.sh /usr/local/bin/wrapper
RUN chmod +x /usr/local/bin/wrapper
CMD ["/usr/local/bin/wrapper"]