Spaces:
Runtime error
Runtime error
matt HOFFNER
commited on
Commit
Β·
46dd491
1
Parent(s):
cf8ccfd
ubuntu
Browse files- Dockerfile +1 -53
Dockerfile
CHANGED
|
@@ -1,56 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
FROM alpine:edge as base
|
| 3 |
-
|
| 4 |
-
# Maintenanceer information
|
| 5 |
-
LABEL maintainer "a76yyyy <q981331502@163.com>"
|
| 6 |
-
LABEL org.opencontainers.image.source=https://github.com/qiandao-today/ddddocr-docker
|
| 7 |
-
|
| 8 |
-
# Envirenment for onnxruntime
|
| 9 |
-
ENV ONNXRUNTIME_TAG=v1.13.1
|
| 10 |
-
|
| 11 |
-
# Replace the alpine image source & Install packages
|
| 12 |
-
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
|
| 13 |
-
echo 'http://mirrors.ustc.edu.cn/alpine/v3.16/main' >> /etc/apk/repositories && \
|
| 14 |
-
echo 'http://mirrors.ustc.edu.cn/alpine/v3.16/community' >> /etc/apk/repositories && \
|
| 15 |
-
apk update && \
|
| 16 |
-
apk add --update --no-cache bash git tzdata nano openssh-client ca-certificates file python3 py3-pip py3-setuptools py3-wheel && \
|
| 17 |
-
# ln -s /usr/bin/python3 /usr/bin/python && \
|
| 18 |
-
[[ $(getconf LONG_BIT) = "32" ]] && \
|
| 19 |
-
{ bashtmp='' && cxxtmp=''; } || { \
|
| 20 |
-
[[ -z $(file /bin/busybox | grep -i "arm") ]] && \
|
| 21 |
-
{ bashtmp='/onnxruntime/build.sh' && cxxtmp=''; } || \
|
| 22 |
-
{ bashtmp='setarch arm64 /onnxruntime/build.sh' && cxxtmp='-Wno-psabi'; }; } && \
|
| 23 |
-
echo $bashtmp && echo $cxxtmp && {\
|
| 24 |
-
[[ -n "$bashtmp" ]] && { \
|
| 25 |
-
apk add --update --no-cache py3-numpy-dev py3-opencv py3-pillow && {\
|
| 26 |
-
apk add --update --no-cache --virtual .build_deps cmake make perl autoconf g++=11.2.1_git20220219-r2 libexecinfo-dev=1.1-r1 automake linux-headers libtool util-linux openblas-dev python3-dev protobuf-dev date-dev gtest-dev eigen-dev py3-pybind11-dev flatbuffers-dev=2.0.0-r1 patch boost-dev nlohmann-json || \
|
| 27 |
-
apk add --update --no-cache --virtual .build_deps cmake make perl autoconf g++=11.2.1_git20220219-r2 libexecinfo-dev=1.1-r1 automake linux-headers libtool util-linux openblas-dev python3-dev protobuf-dev date-dev gtest-dev eigen-dev py3-pybind11-dev patch boost-dev nlohmann-json ;} && \
|
| 28 |
-
git clone --depth 1 --branch $ONNXRUNTIME_TAG https://github.com/Microsoft/onnxruntime && \
|
| 29 |
-
cd /onnxruntime && \
|
| 30 |
-
git submodule update --init --recursive && \
|
| 31 |
-
cd .. && \
|
| 32 |
-
$bashtmp --config MinSizeRel \
|
| 33 |
-
--parallel \
|
| 34 |
-
--build_wheel \
|
| 35 |
-
--enable_pybind \
|
| 36 |
-
--cmake_extra_defines \
|
| 37 |
-
CMAKE_CXX_FLAGS="-Wno-deprecated-copy -Wno-unused-variable -Wno-unused-parameter $cxxtmp"\
|
| 38 |
-
onnxruntime_BUILD_UNIT_TESTS=OFF \
|
| 39 |
-
onnxruntime_BUILD_SHARED_LIB=OFF \
|
| 40 |
-
onnxruntime_USE_PREINSTALLED_EIGEN=ON \
|
| 41 |
-
onnxruntime_PREFER_SYSTEM_LIB=ON \
|
| 42 |
-
eigen_SOURCE_PATH=/usr/include/eigen3 \
|
| 43 |
-
--skip_tests && \
|
| 44 |
-
apk add --update --no-cache libprotobuf-lite && \
|
| 45 |
-
pip install --no-cache-dir /onnxruntime/build/Linux/MinSizeRel/dist/onnxruntime*.whl && \
|
| 46 |
-
ln -s $(python -c 'import warnings;warnings.filterwarnings("ignore");\
|
| 47 |
-
from distutils.sysconfig import get_python_lib;print(get_python_lib())')/onnxruntime/capi/libonnxruntime_providers_shared.so /usr/lib && \
|
| 48 |
-
cd / && rm -rf /onnxruntime && \
|
| 49 |
-
apk del .build_deps ;} || { \
|
| 50 |
-
apk add --update --no-cache libprotobuf-lite && \
|
| 51 |
-
echo "Onnxruntime Builder does not currently support building i386 and arm32 wheels";} ;} && \
|
| 52 |
-
rm -rf /var/cache/apk/* && \
|
| 53 |
-
rm -rf /usr/share/man/*
|
| 54 |
|
| 55 |
# Install dependencies only when needed
|
| 56 |
FROM base AS deps
|
|
|
|
| 1 |
+
FROM ubuntu AS base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
# Install dependencies only when needed
|
| 4 |
FROM base AS deps
|