-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile with variable depth parameter (IDFGH-11513) #12637
Conversation
👋 Welcome timoxd7, thank you for your first contribution to 📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project. Pull request review and merge process you can expectEspressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.
🔁 You can re-run automatic PR checks by retrying the DangerJS action |
fdd829d
to
42d31b4
Compare
Fixed commit message as suggested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @timoxd7! Could you please add a line about this variable also to the docs over here:
- ``IDF_CLONE_SHALLOW``: If this argument is set to a non-empty value, ``--depth=1 --shallow-submodules`` arguments are be used when performing ``git clone``. This significantly reduces the amount of data downloaded and the size of the resulting Docker image. However, if switching to a different branch in such a "shallow" repository is necessary, an additional ``git fetch origin <branch>`` command must be executed first. |
@igrr Forgot about that, i have added it to this pull request and the backport one. |
Thanks, looks good. Don't worry about the backport — since we will also need to update the Chinese version of the documentation (docs/zh_CN/api-guides/tools/idf-tools.rst), we will backport the final version together with the translation. We'll keep you as the commit author, of course. |
sha=7cfdec1649466ff5cb3363803f5f31424c986deb |
Problem
If a docker image is built from a branch that has a commit offset in respect to the last tag while using
IDF_CLONE_SHALLOW
, thegit describe
will fail returning "1".Fix
Add another parameter to specify the depth instead of falling back to "1". If set to the offset of the commit +1, the
git describe
works again, still without cloning the whole repository. For custom IDF and development builds, this helps to get a working build version number again, instead of just "1" being put into the build es ESP IDF Version.Backport
We use ESP-IDF v5.1.x, so a backport would be great.