forked from homebridge/docker-homebridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (67 loc) · 3.02 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
FROM ubuntu:20.04
LABEL org.opencontainers.image.title="Homebridge in Docker"
LABEL org.opencontainers.image.description="Official Homebridge Docker Image"
LABEL org.opencontainers.image.authors="oznu"
LABEL org.opencontainers.image.url="https://github.com/oznu/docker-homebridge"
LABEL org.opencontainers.image.licenses="GPL-3.0"
ENV S6_OVERLAY_VERSION=3.1.1.2 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_KEEP_ENV=1 \
ENABLE_AVAHI=1 \
USER=root \
HOMEBRIDGE_APT_PACKAGE=1 \
UIX_CUSTOM_PLUGIN_PATH="/var/lib/homebridge/node_modules" \
PATH="/opt/homebridge/bin:/var/lib/homebridge/node_modules/.bin:$PATH" \
HOME="/home/homebridge" \
npm_config_prefix=/opt/homebridge
RUN set -x \
&& apt-get update \
&& apt-get install -y curl wget tzdata locales psmisc procps iputils-ping logrotate \
libatomic1 apt-transport-https apt-utils jq openssl sudo nano net-tools \
&& locale-gen en_US.UTF-8 \
&& ln -snf /usr/share/zoneinfo/Etc/GMT /etc/localtime && echo Etc/GMT > /etc/timezone \
&& apt-get install -y python3 python3-pip python3-setuptools git python make g++ libnss-mdns \
avahi-discover libavahi-compat-libdnssd-dev \
&& pip3 install tzupdate \
&& chmod 4755 /bin/ping \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* \
&& rm -rf /etc/cron.daily/apt-compat /etc/cron.daily/dpkg /etc/cron.daily/passwd /etc/cron.daily/exim4-base
RUN case "$(uname -m)" in \
x86_64) S6_ARCH='x86_64';; \
armv7l) S6_ARCH='armhf';; \
aarch64) S6_ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& cd /tmp \
&& set -x \
&& curl -SLOf https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
&& curl -SLOf https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz
RUN case "$(uname -m)" in \
x86_64) FFMPEG_ARCH='x86_64';; \
armv7l) FFMPEG_ARCH='armv7l';; \
aarch64) FFMPEG_ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
&& curl -Lfs https://github.com/homebridge/ffmpeg-for-homebridge/releases/download/v0.1.0/ffmpeg-debian-${FFMPEG_ARCH}.tar.gz | tar xzf - -C / --no-same-owner
ENV HOMEBRIDGE_PKG_VERSION=1.0.30
RUN case "$(uname -m)" in \
x86_64) DEB_ARCH='amd64';; \
armv7l) DEB_ARCH='armhf';; \
aarch64) DEB_ARCH='arm64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
&& curl -sSLf -o /homebridge_${HOMEBRIDGE_PKG_VERSION}.deb https://github.com/homebridge/homebridge-apt-pkg/releases/download/${HOMEBRIDGE_PKG_VERSION}/homebridge_${HOMEBRIDGE_PKG_VERSION}_${DEB_ARCH}.deb \
&& dpkg -i /homebridge_${HOMEBRIDGE_PKG_VERSION}.deb \
&& rm -rf /homebridge_${HOMEBRIDGE_PKG_VERSION}.deb \
&& chown -R root:root /opt/homebridge \
&& rm -rf /var/lib/homebridge
COPY rootfs /
EXPOSE 8581/tcp
VOLUME /homebridge
WORKDIR /homebridge
ENTRYPOINT [ "/init" ]