-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathDockerfile
45 lines (39 loc) · 1.24 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
ARG BUILD_FROM
FROM ${BUILD_FROM}
ARG BUILD_ARCH
ENV ARCH=${BUILD_ARCH}
WORKDIR /usr/src
# Install elf
ARG PATCHELF_VERSION=0.11
RUN apk add --no-cache --virtual .build-dependencies \
build-base \
git \
autoconf \
automake \
&& git clone --depth 1 -b "${PATCHELF_VERSION}" https://github.com/NixOS/patchelf \
&& cd patchelf \
&& ./bootstrap.sh \
&& ./configure \
&& make "-j$(nproc)" \
&& make install \
&& apk del .build-dependencies \
&& rm -rf /usr/src/patchelf
# Install requirements
COPY requirements.txt /usr/src/
RUN apk add --no-cache \
rsync \
openssh-client \
&& pip3 install --no-cache-dir --find-links \
"https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \
pip==20.2 \
&& pip3 install --no-cache-dir --find-links \
"https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \
-r /usr/src/requirements.txt \
&& rm -f /usr/src/requirements.txt
# Install builder
COPY . /usr/src/builder/
RUN pip3 install --no-cache-dir \
/usr/src/builder \
&& rm -fr /usr/src/builder
WORKDIR /data
ENTRYPOINT [ "python3", "-m", "builder" ]