-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile
75 lines (65 loc) · 1.68 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
ARG BUILD_FROM
FROM ${BUILD_FROM}
ARG \
BUILD_ARCH \
CPYTHON_ABI \
QEMU_CPU \
AUDITWHEEL_VERSION=5.1.2 \
PIP_EXTRA_INDEX_URL=https://wheels.home-assistant.io/musllinux-index/ \
WORKDIR /usr/src
SHELL ["/bin/bash", "-exo", "pipefail", "-c"]
COPY rootfs /
# Install requirements
COPY \
requirements.txt \
requirements_${CPYTHON_ABI}.txt \
/usr/src/
RUN \
apk add --no-cache \
rsync \
openssh-client \
patchelf \
build-base \
cmake \
git \
linux-headers \
autoconf \
automake \
cargo \
libffi \
&& apk add --no-cache --virtual .build-dependencies \
libffi-dev \
&& if [ "${BUILD_ARCH}" = "i386" ]; then \
export NPY_DISABLE_SVML=1; \
fi \
&& if [ "${CPYTHON_ABI}" = "cp312" ] && [ "${BUILD_ARCH}" != "amd64" ]; then \
apk add --no-cache --virtual .build-dependencies2 \
openblas-dev; \
fi \
&& pip3 install \
-r /usr/src/requirements.txt \
-r /usr/src/requirements_${CPYTHON_ABI}.txt \
&& rm -rf /usr/src/*
# Install auditwheel
COPY 0001-Support-musllinux-armv6l.patch /usr/src/
RUN \
set -x \
&& git clone --depth 1 -b ${AUDITWHEEL_VERSION} \
https://github.com/pypa/auditwheel \
&& cd auditwheel \
&& git apply /usr/src/0001-Support-musllinux-armv6l.patch \
&& pip install . \
&& rm -rf /usr/src/*
# Install builder
COPY . /usr/src/builder/
RUN \
set -x \
&& pip3 install /usr/src/builder/ \
&& rm -rf /usr/src/*
# Set build environment information
ENV \
ARCH=${BUILD_ARCH} \
ABI=${CPYTHON_ABI}
# Runtime
WORKDIR /data
ENTRYPOINT [ "run-builder.sh" ]