forked from zewelor/bt-mqtt-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.arm32v7
43 lines (34 loc) · 1.59 KB
/
Dockerfile.arm32v7
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
FROM alpine AS builder
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm32v7/alpine:3.9
COPY --from=builder qemu-arm-static /usr/bin
RUN mkdir application
WORKDIR /application
ADD . /application
RUN apk add --no-cache tzdata python3 git bluez glib-dev make bluez-dev bluez-libs musl-dev linux-headers gcc grep && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then \
ln -s pip3 /usr/bin/pip ; \
fi && \
if [[ ! -e /usr/bin/python ]]; then \
ln -sf /usr/bin/python3 /usr/bin/python; \
fi && \
rm -r /root/.cache && \
mkdir /config && \
pip install -r requirements.txt && \
ln -s /config/config.yaml ./config.yaml && \
apk del --no-cache bluez-dev musl-dev gcc make git glib-dev linux-headers grep python2
RUN apk add --no-cache tzdata python3 git bluez glib-dev make bluez-dev bluez-libs bluez-deprecated musl-dev linux-headers gcc grep sudo && \
grep -P "(?<=REQUIREMENTS).*" workers/*.py | grep -Po "(?<=\[).*(?=\])" | tr ',' '\n' | tr "'" " "| tr "\"" " " > /tmp/requirements.txt && \
cat /tmp/requirements.txt && \
pip install -r /tmp/requirements.txt && \
rm /tmp/requirements.txt && \
apk del --no-cache bluez-dev musl-dev gcc make git glib-dev linux-headers grep python2
ADD ./start.sh /start.sh
RUN chmod +x /start.sh
ENV DEBUG false
VOLUME ["/config"]
ENTRYPOINT ["/bin/sh", "-c", "/start.sh"]