forked from ARC-MX/sgcc_electricity_new
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-for-github-action
54 lines (45 loc) · 1.85 KB
/
Dockerfile-for-github-action
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
FROM python:3.9.19-slim-bullseye as build
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ARG TARGETARCH
ARG VERSION=v1.5.0
ENV VERSION=$VERSION
WORKDIR /app
# COPY scripts/* /app/
RUN apt-get --allow-releaseinfo-change update \
&& apt-get install -y --no-install-recommends jq chromium chromium-driver tzdata \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# RUN cd /tmp \
# && python3 -m pip install --upgrade pip \
# && echo '#!/bin/bash\n \
# if [ "$TARGETARCH" = "arm" ]; then\n \
# cd /tmp\n \
# curl -O -L https://github.com/maxisoft/pytorch-arm/releases/download/v1.0.0/numpy-1.23.5-cp39-cp39-linux_armv7l.whl\n \
# curl -v -o onnxruntime-1.16.0-cp39-cp39-linux_armv7l.whl https://github.com/nknytk/built-onnxruntime-for-raspberrypi-linux/blob/master/wheels/bullseye/onnxruntime-1.16.0-cp39-cp39-linux_armv7l.whl\n \
# PIP_ROOT_USER_ACTION=ignore pip3 install numpy-1.23.5-cp39-cp39-linux_armv7l.whl\n \
# PIP_ROOT_USER_ACTION=ignore pip3 install onnxruntime-1.16.0-cp39-cp39-linux_armv7l.whl\n \
# else\n \
# cd /tmp\n \
# PIP_ROOT_USER_ACTION=ignore pip3 install numpy==1.23.5 onnxruntime==1.17.3 \n \
# fi \n' > ./targetArch.sh \
# && bash ./targetArch.sh \
# && rm -rf /tmp/* \
# && pip cache purge \
# && rm -rf /var/lib/apt/lists/* \
# && rm -rf /var/log/*
COPY ./requirements.txt /tmp/requirements.txt
RUN cd /tmp \
&& python3 -m pip install --upgrade pip \
&& PIP_ROOT_USER_ACTION=ignore pip install \
--disable-pip-version-check \
--no-cache-dir \
-r requirements.txt \
&& rm -rf /tmp/* \
&& pip cache purge \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/log/*
ENV LANG=C.UTF-8
CMD ["python"]