-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
64 lines (56 loc) · 1.74 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
#
# Docker file to create an image that contains enough software to listen to events on the 433,92 Mhz band,
# filter these and publish them to a MQTT broker.
#
# The script resides in a volume and should be modified to meet your needs.
#
# The example script filters information from weather stations and publishes the information to topics that
# Domoticz listens on.
#
# Special attention is required to allow the container to access the USB device that is plugged into the host.
# The container needs priviliged access to /dev/bus/usb on the host.
#
# docker run --name rtl_433 -d -e MQTT_HOST=<mqtt-broker.example.com> --privileged -v /dev/bus/usb:/dev/bus/usb <image>
FROM ubuntu:16.04
MAINTAINER Marco Verleun
LABEL Description="This image is used to start a script that will monitor for events on 433,92 Mhz" Vendor="MarCoach" Version="1.0"
#
# First install software packages needed to compile rtl_433 and to publish MQTT events
#
RUN apt-get update && apt-get install -y \
rtl-sdr \
librtlsdr-dev \
librtlsdr0 \
git \
automake \
libtool \
cmake \
mosquitto-clients
#
# Pull RTL_433 source code from GIT, compile it and install it
#
RUN git clone https://github.com/merbanan/rtl_433.git \
&& cd rtl_433/ \
&& mkdir build \
&& cd build \
&& cmake ../ \
&& make \
&& make install
#
# Define an environment variable
#
# Use this variable when creating a container to specify the MQTT broker host.
ENV MQTT_HOST=""
#
# When running a container this script will be executed
#
ENTRYPOINT ["/scripts/rtl2mqtt.sh"]
#
# Copy my script and make it executable
#
COPY rtl2mqtt.sh /scripts/rtl2mqtt.sh
RUN chmod +x /scripts/rtl2mqtt.sh
#
# The script is in a volume. This makes changes persistent and allows you modify it.
#
VOLUME ["/scripts"]