-
Notifications
You must be signed in to change notification settings - Fork 106
/
Dockerfile
83 lines (78 loc) · 3.42 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
80
81
82
83
FROM node:lts-alpine
ENV LANG="C.UTF-8" \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=10000 \
TERM="xterm-256color"
COPY . /app/ring-mqtt
RUN S6_VERSION="v3.2.0.2" && \
BASHIO_VERSION="v0.16.2" && \
GO2RTC_VERSION="v1.9.4" && \
APK_ARCH="$(apk --print-arch)" && \
apk add --no-cache tar xz git bash curl jq tzdata mosquitto-clients && \
curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-noarch.tar.xz" | tar -Jxpf - -C / && \
case "${APK_ARCH}" in \
aarch64|armhf|x86_64) \
curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${APK_ARCH}.tar.xz" | tar Jxpf - -C / ;; \
armv7) \
curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-arm.tar.xz" | tar Jxpf - -C / ;; \
*) \
echo >&2 "ERROR: Unsupported architecture '$APK_ARCH'" \
exit 1;; \
esac && \
mkdir -p /etc/fix-attrs.d && \
mkdir -p /etc/services.d && \
cp -a /app/ring-mqtt/init/s6/* /etc/. && \
chmod +x /etc/cont-init.d/*.sh && \
chmod +x /etc/services.d/ring-mqtt/* && \
rm -Rf /app/ring-mqtt/init && \
case "${APK_ARCH}" in \
x86_64) \
GO2RTC_ARCH="amd64";; \
aarch64) \
GO2RTC_ARCH="arm64";; \
armv7|armhf) \
GO2RTC_ARCH="arm";; \
*) \
echo >&2 "ERROR: Unsupported architecture '$APK_ARCH'" \
exit 1;; \
esac && \
curl -L -s -o /usr/local/bin/go2rtc "https://github.com/AlexxIT/go2rtc/releases/download/${GO2RTC_VERSION}/go2rtc_linux_${GO2RTC_ARCH}" && \
cp "/app/ring-mqtt/bin/go2rtc_linux_${GO2RTC_ARCH}" /usr/local/bin/go2rtc && \
chmod +x /usr/local/bin/go2rtc && \
rm -rf /app/ring-mqtt/bin && \
curl -J -L -o /tmp/bashio.tar.gz "https://github.com/hassio-addons/bashio/archive/${BASHIO_VERSION}.tar.gz" && \
mkdir /tmp/bashio && \
tar zxvf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
chmod +x /app/ring-mqtt/scripts/*.sh && \
mkdir /data && \
chmod 777 /data /app /run && \
cd /app/ring-mqtt && \
chmod +x ring-mqtt.js && \
chmod +x init-ring-mqtt.js && \
npm install && \
rm -Rf /root/.npm && \
rm -f -r /tmp/*
ENTRYPOINT [ "/init" ]
EXPOSE 8554/tcp
EXPOSE 55123/tcp
ARG BUILD_VERSION
ARG BUILD_DATE
LABEL \
io.hass.name="Ring-MQTT with Video Streaming" \
io.hass.description="Home Assistant Community Add-on for Ring Devices" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Tom Sightler <[email protected]>" \
org.opencontainers.image.title="Ring-MQTT with Video Streaming" \
org.opencontainers.image.description="Intergrate wtih Ring devices using MQTT/RTSP" \
org.opencontainers.image.authors="Tom Sightler <[email protected]> (and various other contributors)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/tsightler/ring-mqtt" \
org.opencontainers.image.documentation="https://github.com/tsightler/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.version=${BUILD_VERSION}