| 
1 | 1 | #!/usr/bin/env python3  | 
2 |  | -# Copyright 2020-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.  | 
 | 2 | +# Copyright 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.  | 
3 | 3 | #  | 
4 | 4 | # Redistribution and use in source and binary forms, with or without  | 
5 | 5 | # modification, are permitted provided that the following conditions  | 
@@ -178,7 +178,6 @@ def dockerfile_for_linux(output_file):  | 
178 | 178 |         gnupg1  | 
179 | 179 | 
  | 
180 | 180 | RUN pip3 install patchelf==0.17.2 cmake==4.0.3  | 
181 |  | -
  | 
182 | 181 | """  | 
183 | 182 | 
 
  | 
184 | 183 |     if FLAGS.ort_openvino is not None:  | 
@@ -268,11 +267,8 @@ def dockerfile_for_linux(output_file):  | 
268 | 267 | ARG ONNXRUNTIME_REPO  | 
269 | 268 | ARG ONNXRUNTIME_BUILD_CONFIG  | 
270 | 269 | 
  | 
271 |  | -# Cherry-pick commit: https://github.com/microsoft/onnxruntime/commit/9dad9af9f9b48c05814d0c2d067d0565e8da6ce8  | 
272 |  | -RUN git clone -b rel-${ONNXRUNTIME_VERSION} --recursive ${ONNXRUNTIME_REPO} onnxruntime \\  | 
273 |  | -    && cd onnxruntime \\  | 
274 |  | -    && git cherry-pick -n 9dad9af9f9b48c05814d0c2d067d0565e8da6ce8 \\  | 
275 |  | -    && sed -i 's/5ea4d05e62d7f954a46b3213f9b2535bdd866803/51982be81bbe52572b54180454df11a3ece9a934/g' cmake/deps.txt  | 
 | 270 | +# TODO: Switch to release branch  | 
 | 271 | +RUN git clone -b main --recursive ${ONNXRUNTIME_REPO} onnxruntime  | 
276 | 272 |         """  | 
277 | 273 | 
 
  | 
278 | 274 |     if FLAGS.onnx_tensorrt_tag != "":  | 
@@ -356,38 +352,30 @@ def dockerfile_for_linux(output_file):  | 
356 | 352 | # Copy all artifacts needed by the backend to /opt/onnxruntime  | 
357 | 353 | #  | 
358 | 354 | WORKDIR /opt/onnxruntime  | 
359 |  | -
  | 
360 |  | -RUN mkdir -p /opt/onnxruntime && \  | 
361 |  | -    cp /workspace/onnxruntime/LICENSE /opt/onnxruntime && \  | 
362 |  | -    cat /workspace/onnxruntime/cmake/external/onnx/VERSION_NUMBER > /opt/onnxruntime/ort_onnx_version.txt  | 
 | 355 | +RUN cp /workspace/onnxruntime/LICENSE . \\  | 
 | 356 | +    && cat /workspace/onnxruntime/cmake/external/onnx/VERSION_NUMBER > ort_onnx_version.txt  | 
363 | 357 | 
  | 
364 | 358 | # ONNX Runtime headers, libraries and binaries  | 
365 |  | -RUN mkdir -p /opt/onnxruntime/include && \  | 
366 |  | -    cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h \  | 
367 |  | -       /opt/onnxruntime/include && \  | 
368 |  | -    cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h \  | 
369 |  | -       /opt/onnxruntime/include && \  | 
370 |  | -    cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h \  | 
371 |  | -       /opt/onnxruntime/include  | 
 | 359 | +WORKDIR /opt/onnxruntime/include  | 
 | 360 | +RUN cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h . \\  | 
 | 361 | +    && cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h . \\  | 
 | 362 | +    && cp /workspace/onnxruntime/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h . \\  | 
 | 363 | +    && cp /workspace/onnxruntime/include/onnxruntime/core/session/onnxruntime_ep_c_api.h .  | 
372 | 364 | 
  | 
373 |  | -RUN mkdir -p /opt/onnxruntime/lib && \  | 
374 |  | -    cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so \  | 
375 |  | -       /opt/onnxruntime/lib && \  | 
376 |  | -    cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so \  | 
377 |  | -       /opt/onnxruntime/lib  | 
 | 365 | +WORKDIR /opt/onnxruntime/lib  | 
 | 366 | +RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_shared.so . \\  | 
 | 367 | +    && cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime.so .  | 
378 | 368 | """  | 
379 | 369 |     if target_platform() == "igpu":  | 
380 | 370 |         df += """  | 
381 | 371 | RUN mkdir -p /opt/onnxruntime/bin  | 
382 | 372 | """  | 
383 | 373 |     else:  | 
384 | 374 |         df += """  | 
385 |  | -RUN mkdir -p /opt/onnxruntime/bin && \  | 
386 |  | -    cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test \  | 
387 |  | -       /opt/onnxruntime/bin && \  | 
388 |  | -    cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner \  | 
389 |  | -       /opt/onnxruntime/bin && \  | 
390 |  | -    (cd /opt/onnxruntime/bin && chmod a+x *)  | 
 | 375 | +WORKDIR /opt/onnxruntime/bin  | 
 | 376 | +RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnxruntime_perf_test . \\  | 
 | 377 | +    && cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/onnx_test_runner . \\  | 
 | 378 | +    && chmod a+x *  | 
391 | 379 | """  | 
392 | 380 | 
 
  | 
393 | 381 |     if FLAGS.enable_gpu:  | 
 | 
0 commit comments