ci: optimize layer cache for docker build test

use different image tag for different concurrent job
This commit is contained in:
Chen Yudong
2026-05-11 16:40:07 +08:00
parent 372fc66ea6
commit d69e268e6b
2 changed files with 17 additions and 12 deletions
+11 -9
View File
@@ -39,6 +39,16 @@ RUN : \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
&& :
ARG IDF_INSTALL_TARGETS=all
# install build essential needed for linux target apps, which is a preview target so it is installed with "all" only
RUN if [ "$IDF_INSTALL_TARGETS" = "all" ]; then \
apt-get update \
&& apt-get install -y build-essential \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* ; \
fi
# To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
# To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
# It is possible to combine both, e.g.:
@@ -53,21 +63,13 @@ ARG IDF_CLONE_BRANCH_OR_TAG=master
ARG IDF_CHECKOUT_REF=
ARG IDF_CLONE_SHALLOW=
ARG IDF_CLONE_SHALLOW_DEPTH=1
ARG IDF_INSTALL_TARGETS=all
ARG IDF_GITHUB_ASSETS=
ARG PIP_INDEX_URL=
ENV IDF_PATH=/opt/esp/idf
ENV IDF_TOOLS_PATH=/opt/esp
ENV IDF_GITHUB_ASSETS=${IDF_GITHUB_ASSETS}
# install build essential needed for linux target apps, which is a preview target so it is installed with "all" only
RUN if [ "$IDF_INSTALL_TARGETS" = "all" ]; then \
apt-get update \
&& apt-get install -y build-essential \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* ; \
fi
RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_BRANCH_OR_TAG && \
git clone --recursive \
${IDF_CLONE_SHALLOW:+--depth=${IDF_CLONE_SHALLOW_DEPTH} --shallow-submodules} \