Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions opt/build/onnxruntime/Dockerfile.x64
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
# BUILD redisfab/onnxruntime-x64-${OS}:$(ONNXRUNTIME_VER)

ARG OS=ubuntu:16.04

#----------------------------------------------------------------------------------------------
FROM ${OS}

ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime
ARG ONNXRUNTIME_VER=1.7.1
ARG ARCH=x64

RUN apt-get -qq update
RUN apt-get -qq install -y curl wget tar git \
build-essential cmake \
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get -qq update

RUN apt-get -qq install -y python3.6 curl wget tar git \
build-essential \
libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \
python3 python3-pip python3-dev python3-numpy
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
WORKDIR /tmp
RUN tar -zxpf /tmp/cmake.tgz
RUN mv /tmp/cmake*/bin/* /usr/bin
RUN mv /tmp/cmake-*/share/cmake* /usr/share/

RUN rm /usr/bin/python3
RUN ln -s /usr/bin/python3.6 /usr/bin/python3

RUN pip3 install --upgrade pip setuptools wheel

ENV LANG=en_US.UTF-8
RUN apt-get install -y locales && \
sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=$LANG

WORKDIR /build

ARG BUILDTYPE=MinSizeRel

ARG BUILDTYPE=Release
ARG BUILDARGS="--config ${BUILDTYPE} --parallel"

RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} ${ONNXRUNTIME_REPO} onnxruntime
WORKDIR /build/onnxruntime
RUN git fetch --recurse-submodules -j4
RUN git fetch --recurse-submodules
RUN ./build.sh ${BUILDARGS} --update --build
RUN ./build.sh ${BUILDARGS} --build_shared_lib
# RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel

ADD ./pack.sh /build
WORKDIR /build
RUN ./pack.sh ${ONNXRUNTIME_VER} ${ARCH}
2 changes: 1 addition & 1 deletion opt/build/onnxruntime/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VER="$1"
PLATFORM="$2"

mkdir -p pack/include pack/lib
cp onnxruntime/build/Linux/MinSizeRel/libonnxruntime.so.${VER} pack/lib/
cp onnxruntime/build/Linux/Release/libonnxruntime.so.${VER} pack/lib/
cp onnxruntime/docs/C_API_Guidelines.md pack/
cp onnxruntime/LICENSE pack/
cp onnxruntime/README.md pack/
Expand Down