Feature request: Allow specifying subdirectory with default git context
See original GitHub issueWhen using git repository contexts, Docker allows specifying a subdirectory using the syntax <repo>#<ref>:<subdir>
, as documented here:
BuildKit used to not support this feature, but as of BuildKit 0.9.0, it does:
- Release notes: https://github.com/moby/buildkit/releases/tag/v0.9.0
- https://github.com/moby/buildkit/issues/1684
- https://github.com/moby/buildkit/pull/2116
Can this action add support for this, to avoid the need to use checkouts to build subdirectories?
Workaround
For the time being, specifying a full git context seems to work; for example, to build subdirectory spam
:
- uses: docker/build-push-action@v2
with:
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:spam"
However, this doesn’t use the same logic for determining the default git context as the action does, so it might be fragile.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
git-config Documentation - Git
Opens an editor to modify the specified config file; either --system , --global , or repository (default). --[no-]includes. Respect include.* directives in ...
Read more >Using Git submodules with GitLab CI/CD
Use Git submodules to keep a Git repository as a subdirectory of another Git ... For problems setting up or using this feature...
Read more >Source Control with Git in Visual Studio Code
Staging (git add) and unstaging (git reset) can be done via contextual actions in the files or by drag-and-drop. Configure your Git username...
Read more >Documentation – TortoiseGit – Windows Shell Interface to Git
This page allows you to specify which of the TortoiseGit context menu entries will be hidden by default. Selected item will only be...
Read more >Configure Hosting behavior | Firebase Hosting - Google
The ignore attribute specifies the files to ignore on deploy. It can take globs the same way that Git handles .gitignore . The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@PiDelport Do you have an example on how to add credentials to the URL?
Yes, for private repositories, you’ll probably need to add credentials from an appropriate environment variable to the URL.