Skip to content

Commit e4c1717

Browse files
committed
Update Dockerfile generation instructions
1 parent 7390b1c commit e4c1717

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -373,33 +373,26 @@ def dockerfile_for_linux(output_file):
373373
cat /workspace/onnxruntime/cmake/external/onnx/VERSION_NUMBER > /opt/onnxruntime/ort_onnx_version.txt
374374
375375
# ONNX Runtime headers, libraries and binaries
376-
RUN mkdir -p /opt/onnxruntime/include && \
377-
cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h \
378-
/opt/onnxruntime/include && \
379-
cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h \
380-
/opt/onnxruntime/include && \
381-
cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h \
382-
/opt/onnxruntime/include \\
383-
&& /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_ep_c_api.h /opt/onnxruntime/include
384-
385-
RUN mkdir -p /opt/onnxruntime/lib && \
386-
cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so \
387-
/opt/onnxruntime/lib && \
388-
cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so \
389-
/opt/onnxruntime/lib
376+
WORKDIR /opt/onnxruntime/include
377+
RUN cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h . \\
378+
&& cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h . \\
379+
&& cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h . \\
380+
&& cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_ep_c_api.h .
381+
382+
WORKDIR /opt/onnxruntime/lib
383+
RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so . \\
384+
&& cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so .
390385
"""
391386
if target_platform() == "igpu":
392387
df += """
393388
RUN mkdir -p /opt/onnxruntime/bin
394389
"""
395390
else:
396391
df += """
397-
RUN mkdir -p /opt/onnxruntime/bin && \
398-
cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test \
399-
/opt/onnxruntime/bin && \
400-
cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner \
401-
/opt/onnxruntime/bin && \
402-
(cd /opt/onnxruntime/bin && chmod a+x *)
392+
WORKDIR /opt/onnxruntime/bin
393+
RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test . \\
394+
&& cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner . \\
395+
&& chmod a+x *
403396
"""
404397

405398
if FLAGS.enable_gpu:

0 commit comments

Comments
 (0)