Skip to content

Commit cca6c55

Browse files
committed
build(docker): avoid git clones
Avoid failures and reduce layer size.
1 parent 305a053 commit cca6c55

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/docker/itk-wasm-base/Dockerfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ RUN curl -LO https://nodejs.org/dist/${NODE_TAG}/node-${NODE_TAG}-linux-x64.tar.
1919
ENV PATH /emsdk/upstream/emscripten:${PATH}
2020

2121
ENV zstd_GIT_TAG v1.5.5
22-
RUN git clone https://github.com/facebook/zstd.git && \
23-
cd zstd && \
24-
git checkout ${zstd_GIT_TAG} && \
25-
cd / && \
22+
RUN curl -L https://github.com/api/repos/facebook/zstd/tarball/${zstd_GIT_TAG} | tar xz --strip=1 --one-top-level=zstd && \
2623
mkdir zstd-build && \
2724
cd zstd-build && \
2825
CC=cc CXX=c++ /usr/bin/cmake \
@@ -37,11 +34,9 @@ RUN git clone https://github.com/facebook/zstd.git && \
3734
rm -rf zstd-build zstd
3835

3936
# tag commit date: 2024-05-05 branch: itkwasm-2024-05-03-e5a84a08a30
40-
ENV ITK_GIT_TAG 0f306658360391c66922deecc19b40b6e7fcdfef
41-
RUN git clone https://github.com/KitwareMedical/ITK.git && \
42-
cd ITK && \
43-
git checkout ${ITK_GIT_TAG} && \
44-
cd ../ && \
37+
ENV ITK_GIT_TAG 2282cb5b41d1333fd68ba14af4cbc5a1c0d0f965
38+
ENV ITK_GIT_BRANCH itkwasm-2024-05-03-e5a84a08a30
39+
RUN git clone --branch $ITK_GIT_BRANCH --single-branch --depth 1 https://github.com/KitwareMedical/ITK.git && \
4540
sed -i -e '/^option(OPJ_USE_THREAD/c\option(OPJ_USE_THREAD "use threads" OFF)' \
4641
/ITK/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt
4742

@@ -53,8 +48,8 @@ RUN sed -i -e '/^set(DCMTK_GIT_REPOSITORY/c\set(DCMTK_GIT_REPOSITORY "https://gi
5348
RUN sed -i -e '/^set(DCMTK_GIT_TAG/c\set(DCMTK_GIT_TAG "fe7cff5de40b67ae0490d476ddf17689c06bcaf4")' \
5449
/ITK/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake
5550

56-
RUN if [[ -e $WASI_SDK_PATH/share/cmake/wasi-sdk.cmake ]]; then sed -i '/cmake_minimum_required/d' $WASI_SDK_PATH/share/cmake/wasi-sdk.cmake; fi
57-
RUN if [[ -e $WASI_SDK_PATH/share/cmake/wasi-sdk-threads.cmake ]]; then sed -i '/cmake_minimum_required/d' $WASI_SDK_PATH/share/cmake/wasi-sdk-threads.cmake; fi
51+
RUN if test -e $WASI_SDK_PATH/share/cmake/wasi-sdk.cmake; then sed -i '/cmake_minimum_required/d' $WASI_SDK_PATH/share/cmake/wasi-sdk.cmake; fi
52+
RUN if test -e $WASI_SDK_PATH/share/cmake/wasi-sdk-threads.cmake; then sed -i '/cmake_minimum_required/d' $WASI_SDK_PATH/share/cmake/wasi-sdk-threads.cmake; fi
5853

5954
ARG CMAKE_BUILD_TYPE=Release
6055

0 commit comments

Comments
 (0)