From adb38266c4a9c3b4bc07c2d21a681a92cd1660fd Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 24 Nov 2023 14:32:11 +0800 Subject: [PATCH] ci: enable shallow clone in docker image generation to reduce image size If depth changed to 10, the image size is 2.12GB compared with full clone 7.35GB Full clone source code is 5.98GB, shallow clone depth 10 is 769MB generated work folder is about 998MB Signed-off-by: Huaqi Fang <578567190@qq.com> --- .github/linuxsdk.Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/linuxsdk.Dockerfile b/.github/linuxsdk.Dockerfile index 5e4fbe7..5fce5f5 100644 --- a/.github/linuxsdk.Dockerfile +++ b/.github/linuxsdk.Dockerfile @@ -60,12 +60,14 @@ ENV PATH "/home/$USER/prebuilt/qemu/bin:$PATH" RUN ldd `which qemu-system-riscv64` -RUN git clone -b $BRANCH https://github.com/Nuclei-Software/nuclei-linux-sdk +# do shallow clone for main repo +RUN git clone --depth 5 -b $BRANCH https://github.com/Nuclei-Software/nuclei-linux-sdk # gitee mirror no longer works #RUN cd nuclei-linux-sdk && git remote add gitee https://gitee.com/Nuclei-Software/nuclei-linux-sdk -RUN cd nuclei-linux-sdk && git submodule init && git submodule update --recursive --init +# only do shallow clone for submodule to reduce clone size +RUN cd nuclei-linux-sdk && git submodule init && git submodule update --recursive --init --depth 5 RUN cd nuclei-linux-sdk && make freeloader bootimages