|
1 | 1 | # BUILD redisfab/onnxruntime-x64-${OS}:$(ONNXRUNTIME_VER) |
2 | | - |
3 | 2 | ARG OS=ubuntu:16.04 |
4 | | - |
5 | 3 | #---------------------------------------------------------------------------------------------- |
6 | 4 | FROM ${OS} |
7 | | - |
8 | 5 | ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime |
9 | 6 | ARG ONNXRUNTIME_VER=1.7.1 |
10 | 7 | ARG ARCH=x64 |
11 | 8 |
|
12 | 9 | RUN apt-get -qq update |
13 | | -RUN apt-get -qq install -y curl wget tar git \ |
14 | | - build-essential cmake \ |
| 10 | +RUN apt-get install -y software-properties-common |
| 11 | +RUN add-apt-repository ppa:deadsnakes/ppa |
| 12 | +RUN apt-get -qq update |
| 13 | + |
| 14 | +RUN apt-get -qq install -y python3.6 curl wget tar git \ |
| 15 | + build-essential \ |
15 | 16 | libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \ |
16 | 17 | python3 python3-pip python3-dev python3-numpy |
| 18 | +RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.19.7/cmake-3.19.7-Linux-x86_64.tar.gz -O /tmp/cmake.tgz |
| 19 | +WORKDIR /tmp |
| 20 | +RUN tar -zxpf /tmp/cmake.tgz |
| 21 | +RUN mv /tmp/cmake*/bin/* /usr/bin |
| 22 | +RUN mv /tmp/cmake-*/share/cmake* /usr/share/ |
| 23 | + |
| 24 | +RUN rm /usr/bin/python3 |
| 25 | +RUN ln -s /usr/bin/python3.6 /usr/bin/python3 |
| 26 | + |
17 | 27 | RUN pip3 install --upgrade pip setuptools wheel |
18 | 28 |
|
19 | 29 | ENV LANG=en_US.UTF-8 |
20 | 30 | RUN apt-get install -y locales && \ |
21 | 31 | sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \ |
22 | 32 | dpkg-reconfigure --frontend=noninteractive locales && \ |
23 | 33 | update-locale LANG=$LANG |
24 | | - |
25 | 34 | WORKDIR /build |
26 | | - |
27 | | -ARG BUILDTYPE=MinSizeRel |
28 | | - |
| 35 | +ARG BUILDTYPE=Release |
29 | 36 | ARG BUILDARGS="--config ${BUILDTYPE} --parallel" |
30 | | - |
31 | 37 | RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} ${ONNXRUNTIME_REPO} onnxruntime |
32 | 38 | WORKDIR /build/onnxruntime |
33 | | -RUN git fetch --recurse-submodules -j4 |
| 39 | +RUN git fetch --recurse-submodules |
34 | 40 | RUN ./build.sh ${BUILDARGS} --update --build |
35 | 41 | RUN ./build.sh ${BUILDARGS} --build_shared_lib |
36 | 42 | # RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel |
37 | | - |
38 | 43 | ADD ./pack.sh /build |
39 | 44 | WORKDIR /build |
40 | 45 | RUN ./pack.sh ${ONNXRUNTIME_VER} ${ARCH} |
0 commit comments