Skip to content

Commit 943280e

Browse files
committed
docker: update ESP-IDF installation process
Refactor the ESP-IDF installation in the Containerfile to improve efficiency by using shallow submodules and removing unnecessary git history. This change reduces the size of the cloned repository and speeds up the build process. Signed-off-by: Chiho Sin <[email protected]>
1 parent 8be2fd6 commit 943280e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Containerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,12 @@ ENV IDF_TOOLS_PATH=/opt/esp-idf-tools
106106
ENV ESP_ROM_ELF_DIR=/opt/esp-idf-tools
107107

108108
ARG IDF_VERSION=v5.4.2
109-
RUN git clone --depth 1 --filter=tree:0 -b "${IDF_VERSION}" https://github.com/espressif/esp-idf.git "${IDF_PATH}"
110-
RUN cd ${IDF_PATH} \
111-
&& git submodule update --init --depth=1 --recursive \
112-
&& git repack -d \
113-
&& rm -rf "${IDF_PATH}"/.git \
114-
&& cd /workspace \
115-
&& git repack -d
109+
RUN git clone -b "${IDF_VERSION}" --recursive --depth 1 --shallow-submodules https://github.com/espressif/esp-idf.git "${IDF_PATH}" \
110+
&& rm -rf "${IDF_PATH}"/.git
116111

117112
RUN --mount=type=cache,target=/root/.cache/pip \
118113
--mount=type=cache,target=/opt/esp-idf-tools/dist \
119-
"${IDF_PATH}"/install.sh > /dev/null 2>&1 \
114+
"${IDF_PATH}"/install.sh "esp32,esp32c2,esp32c3,esp32c6,esp32s2,esp32s3" > /dev/null 2>&1 \
120115
&& bash -c "source ${IDF_PATH}/export.sh && pip3 install --upgrade minify-html jsmin sh requests-cache"
121116

122117
RUN bash -c "source ${IDF_PATH}/export.sh && make -C ports/esp32 submodules && git repack -d"

0 commit comments

Comments
 (0)