-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.homeassistant
105 lines (100 loc) · 2.95 KB
/
Dockerfile.homeassistant
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
ARG ARCH=amd64
FROM ghcr.io/linuxserver/baseimage-alpine:${ARCH}-3.18
ARG ARCH=amd64
ARG GRPC_BUILD_WITH_BORING_SSL_ASM=false
ARG GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true
ARG GRPC_PYTHON_BUILD_WITH_CYTHON=true
ARG GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=true
# environment settings
ENV PIPFLAGS="--no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.18/ --find-links https://wheel-index.linuxserver.io/homeassistant-3.18/"
# install packages
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
autoconf \
ca-certificates \
cargo \
cmake \
cups-dev \
eudev-dev \
ffmpeg-dev \
gcc \
glib-dev \
g++ \
jq \
libffi-dev \
jpeg-dev \
libxml2-dev \
libxslt-dev \
make \
mariadb-dev \
postgresql-dev \
python3-dev \
unixodbc-dev \
unzip && \
echo "**** install runtime packages ****" && \
apk add --no-cache --virtual=runtime-dependencies \
bluez \
bluez-deprecated \
bluez-libs \
cups-libs \
curl \
eudev-libs \
ffmpeg \
iputils \
libcap \
libjpeg-turbo \
libstdc++ \
libxslt \
mariadb-connector-c \
mariadb-connector-c-dev \
openssh-client \
openssl \
postgresql-libs \
py3-pip \
python3 \
tiff && \
echo "**** retrieve homeassistant ****" && \
mkdir -p \
/tmp/core && \
export HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
| jq -r .tag_name) && \
curl -o \
/tmp/core.tar.gz -L \
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
tar xf \
/tmp/core.tar.gz -C \
/tmp/core --strip-components=1 && \
export HASS_BASE=$(cat /tmp/core/build.yaml \
| grep 'amd64: ' \
| cut -d: -f3) && \
echo "**** Updating pip and building wheels ****" && \
python3 -m venv /lsiopy && \
pip install -U --no-cache-dir "pip>=21.0,<22.1" setuptools wheel cython && \
mkdir -p /build && \
cd /tmp/core && \
NUMPY_VER=$(grep "numpy" requirements_all.txt) && \
PYCUPS_VER=$(grep "pycups" requirements_all.txt | sed 's|.*==||') && \
pip wheel --wheel-dir=/build ${PIPFLAGS} \
"${NUMPY_VER}" && \
pip install /build/numpy*.whl && \
pip wheel --wheel-dir=/build ${PIPFLAGS} --only-binary cmake \
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
pip wheel --wheel-dir=/build ${PIPFLAGS} --only-binary cmake \
-r requirements_all.txt && \
pip wheel --wheel-dir=/build ${PIPFLAGS} --only-binary cmake \
pycups==${PYCUPS_VER} && \
pip wheel --wheel-dir=/build ${PIPFLAGS} --only-binary cmake \
homeassistant==${HASS_RELEASE} && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies \
runtime-dependencies && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* \
${HOME}/.cargo \
${HOME}/.cache && \
echo "**** Wheels built are: ****" && \
ls /build