forked from home-assistant/addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
85 lines (81 loc) · 2.27 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
84
85
ARG BUILD_FROM
FROM $BUILD_FROM
# Setup base
ARG LIBWEBSOCKETS_VERSION
ARG TTYD_VERSION
RUN \
set -x \
&& apk add --no-cache \
bash-completion \
pulseaudio-utils \
alsa-plugins-pulse \
bluez \
git \
libuv \
mosquitto-clients \
nano \
openssh \
pwgen \
tmux \
vim \
\
&& apk add --no-cache --virtual .build-dependencies \
bsd-compat-headers \
build-base \
linux-headers \
cmake \
json-c-dev \
libuv-dev \
openssl-dev \
zlib-dev \
\
&& sed -i "s/ash/bash/" /etc/passwd \
\
&& git clone --branch "v${LIBWEBSOCKETS_VERSION}" --depth=1 \
https://github.com/warmcat/libwebsockets.git /tmp/libwebsockets \
\
&& mkdir -p /tmp/libwebsockets/build \
&& cd /tmp/libwebsockets/build \
&& cmake .. \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DLWS_IPV6=ON \
-DLWS_STATIC_PIC=ON \
-DLWS_UNIX_SOCK=ON \
-DLWS_WITH_LIBUV=ON \
-DLWS_WITH_SHARED=ON \
-DLWS_WITHOUT_TESTAPPS=ON \
&& make \
&& make install \
\
&& git clone --branch main --single-branch \
https://github.com/tsl0922/ttyd.git /tmp/ttyd \
&& git -C /tmp/ttyd checkout "${TTYD_VERSION}" \
\
&& mkdir -p /tmp/ttyd/build \
&& cd /tmp/ttyd/build \
&& cmake .. \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
&& make \
&& make install \
\
&& apk del --no-cache --purge .build-dependencies \
&& rm -f -r \
/root/.cache \
/root/.cmake \
/tmp/*
# Add YAML highlighting for nano
ADD https://raw.githubusercontent.com/scopatz/nanorc/master/yaml.nanorc /usr/share/nano/yaml.nanorc
RUN sed -i 's/^#[[:space:]]*\(include "\/usr\/share\/nano\/\*\.nanorc".*\)/\1/' /etc/nanorc
# Home Assistant CLI
ARG BUILD_ARCH
ARG CLI_VERSION
RUN curl -Lso /usr/bin/ha \
"https://github.com/home-assistant/cli/releases/download/${CLI_VERSION}/ha_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/ha \
&& /usr/bin/ha completion > /usr/share/bash-completion/completions/ha
# Copy data
COPY rootfs /