diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 20725b9..23b60b2 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -132,6 +132,22 @@ def dockerfile_for_linux(output_file): RUN pip3 install patchelf==0.17.2 """ else: + if os.getenv("CCACHE_REMOTE_ONLY") and os.getenv("CCACHE_REMOTE_STORAGE"): + df += """ +ENV CCACHE_REMOTE_ONLY="true" \\ + CCACHE_REMOTE_STORAGE="{}" \\ + CMAKE_CXX_COMPILER_LAUNCHER="ccache" \\ + CMAKE_C_COMPILER_LAUNCHER="ccache" \\ + CMAKE_CUDA_COMPILER_LAUNCHER="ccache" \\ + VERBOSE=1 + +RUN apt-get update \\ + && apt-get install -y --no-install-recommends ccache && ccache -p \\ + && rm -rf /var/lib/apt/lists/* +""".format( + os.getenv("CCACHE_REMOTE_STORAGE") + ) + df += """ RUN apt-get update && apt-get install -y --no-install-recommends \