Skip to content

Commit

Permalink
ci: enable shallow clone in docker image generation to reduce image size
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fanghuaqi committed Nov 24, 2023
1 parent 8c29a3f commit adb3826
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/linuxsdk.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit adb3826

Please sign in to comment.