diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index dc47554..7a6dc87 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -178,7 +178,6 @@ def dockerfile_for_linux(output_file): gnupg1 RUN pip3 install patchelf==0.17.2 cmake==4.0.3 - """ if FLAGS.ort_openvino is not None: @@ -268,11 +267,7 @@ def dockerfile_for_linux(output_file): ARG ONNXRUNTIME_REPO ARG ONNXRUNTIME_BUILD_CONFIG -# Cherry-pick commit: https://github.com/microsoft/onnxruntime/commit/9dad9af9f9b48c05814d0c2d067d0565e8da6ce8 -RUN git clone -b rel-${ONNXRUNTIME_VERSION} --recursive ${ONNXRUNTIME_REPO} onnxruntime \\ - && cd onnxruntime \\ - && git cherry-pick -n 9dad9af9f9b48c05814d0c2d067d0565e8da6ce8 \\ - && sed -i 's/5ea4d05e62d7f954a46b3213f9b2535bdd866803/51982be81bbe52572b54180454df11a3ece9a934/g' cmake/deps.txt +RUN git clone -b rel-${ONNXRUNTIME_VERSION} --recursive ${ONNXRUNTIME_REPO} onnxruntime """ if FLAGS.onnx_tensorrt_tag != "": @@ -356,25 +351,19 @@ def dockerfile_for_linux(output_file): # Copy all artifacts needed by the backend to /opt/onnxruntime # WORKDIR /opt/onnxruntime - -RUN mkdir -p /opt/onnxruntime && \ - cp /workspace/onnxruntime/LICENSE /opt/onnxruntime && \ - cat /workspace/onnxruntime/cmake/external/onnx/VERSION_NUMBER > /opt/onnxruntime/ort_onnx_version.txt +RUN cp /workspace/onnxruntime/LICENSE . \\ + && cat /workspace/onnxruntime/cmake/external/onnx/VERSION_NUMBER > ort_onnx_version.txt # ONNX Runtime headers, libraries and binaries -RUN mkdir -p /opt/onnxruntime/include && \ - cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h \ - /opt/onnxruntime/include && \ - cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h \ - /opt/onnxruntime/include && \ - cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h \ - /opt/onnxruntime/include +WORKDIR /opt/onnxruntime/include +RUN cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h . \\ + && cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h . \\ + && cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h . \\ + && cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_ep_c_api.h . -RUN mkdir -p /opt/onnxruntime/lib && \ - cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so \ - /opt/onnxruntime/lib && \ - cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so \ - /opt/onnxruntime/lib +WORKDIR /opt/onnxruntime/lib +RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so . \\ + && cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so . """ if target_platform() == "igpu": df += """ @@ -382,12 +371,10 @@ def dockerfile_for_linux(output_file): """ else: df += """ -RUN mkdir -p /opt/onnxruntime/bin && \ - cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test \ - /opt/onnxruntime/bin && \ - cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner \ - /opt/onnxruntime/bin && \ - (cd /opt/onnxruntime/bin && chmod a+x *) +WORKDIR /opt/onnxruntime/bin +RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test . \\ + && cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner . \\ + && chmod a+x * """ if FLAGS.enable_gpu: