question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Allow specifying subdirectory with default git context

See original GitHub issue

When 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:

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
simensolcommented, Apr 16, 2022

@PiDelport Do you have an example on how to add credentials to the URL?

0reactions
PiDelportcommented, Mar 25, 2022

Yes, for private repositories, you’ll probably need to add credentials from an appropriate environment variable to the URL.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found