2019-05-09 01:24:16 +00:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
#--------------------------------------------------------------------------
|
2019-06-21 17:28:06 +00:00
|
|
|
# Official docker container for ONNX Runtime Server
|
2019-05-09 01:24:16 +00:00
|
|
|
# Ubuntu 16.04, CPU version, Python 3.
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
FROM ubuntu:16.04 AS minimal
|
|
|
|
|
MAINTAINER Harry Yang "huayang@microsoft.com"
|
|
|
|
|
|
|
|
|
|
FROM ubuntu:16.04 AS build
|
|
|
|
|
ARG PYTHON_VERSION=3.5
|
2019-06-20 16:55:42 +00:00
|
|
|
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
2019-05-09 01:24:16 +00:00
|
|
|
ARG ONNXRUNTIME_SERVER_BRANCH=master
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
|
apt-get install -y sudo git bash
|
|
|
|
|
|
|
|
|
|
ENV PATH="/opt/cmake/bin:${PATH}"
|
2019-06-20 16:55:42 +00:00
|
|
|
RUN git clone --single-branch --branch ${ONNXRUNTIME_SERVER_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime
|
2020-03-15 21:46:46 +00:00
|
|
|
RUN /onnxruntime/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh -p ${PYTHON_VERSION} \
|
|
|
|
|
&& /onnxruntime/tools/ci_build/github/linux/docker/scripts/install_server_deps.sh
|
2019-07-18 18:10:38 +00:00
|
|
|
|
|
|
|
|
ENV PATH="/usr/local/go/bin:${PATH}"
|
2019-05-09 01:24:16 +00:00
|
|
|
|
|
|
|
|
WORKDIR /
|
2020-03-15 21:46:46 +00:00
|
|
|
RUN mkdir -p /onnxruntime/build && cd /onnxruntime/build && cmake -DCMAKE_BUILD_TYPE=Release /onnxruntime/server \
|
|
|
|
|
&& make -j$(getconf _NPROCESSORS_ONLN)
|
2019-05-09 01:24:16 +00:00
|
|
|
|
|
|
|
|
FROM minimal AS final
|
2020-03-15 21:46:46 +00:00
|
|
|
COPY --from=build /onnxruntime/build/onnxruntime_server /onnxruntime/server/
|
|
|
|
|
COPY --from=build /usr/lib/libonnxruntime.so.1.2.0 /usr/local/lib/libcares.so.2.3.0 /usr/lib/
|
|
|
|
|
RUN ln -s /usr/lib/libonnxruntime.so.1.2.0 /usr/lib/libonnxruntime.so && ln -s /usr/local/lib/libcares.so.2.3.0 /usr/local/lib/libcares.so.2 && ln -s /usr/local/lib/libcares.so.2 /usr/local/lib/libcares.so && ldconfig /usr/local/lib && apt-get update \
|
|
|
|
|
&& apt-get install -y libgomp1 libre2-1v5 libssl1.0.0
|
2019-05-09 01:24:16 +00:00
|
|
|
WORKDIR /onnxruntime/server/
|
2019-08-29 17:18:08 +00:00
|
|
|
ENTRYPOINT ["/onnxruntime/server/onnxruntime_server"]
|