-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for subdirectories when building from git source #1684
Comments
This would be great indeed, but if we want further optimizations in git protocol, I found However, in the code we are not using git clone, but git init + git remote + git fetch. The weird thing is that git fetch --filter is not documented (oversight?) but does exist in the code. Another caveat is that --filter only works with repos that have explicit support for partial clone, greatly limiting the reach of this optimization. Unclear whether there's a tradeoff or why it's not default. |
Just ran into this, but was confused, because I wasn't using a subdirectory, I had specified Due to buildkit/source/gitidentifier.go Lines 46 to 48 in 477b1aa
Maybe the subdirectory check should be exteneded to allow Hope this helps someone else who runs into this. |
Sounds reasonable to ignore that case (my 0.02c); feel free to open a pull request for that |
any progress for this issues? my apps contain multiple containers and subfolder, need this to be fixed. |
busco el doker de tcp y udp |
Second. Any traction on this? We keep our dockerfiles in a |
… you can use the path context in the meantime. More info on Docker docs website.
Sparse checkout now works on github see https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository and https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/ - not sure where else though, it is not clear if we should have a fallback or fail if the server does not support it. |
docker build does not seem to like finding Dockerfiles in sub-directories. moby/buildkit#1684
docker build does not seem to like finding Dockerfiles in sub-directories. moby/buildkit#1684
docker build does not seem to like finding Dockerfiles in sub-directories. moby/buildkit#1684
docker build does not seem to like finding Dockerfiles in sub-directories. moby/buildkit#1684
As noted in docker/build-push-action#120 (comment), specifying a sub-directory when building from a git source is not yet supported in BuildKit;
buildkit/source/gitidentifier.go
Lines 46 to 48 in 477b1aa
The PR that added this feature doesn't clearly mention if there's specific reasons for it not to be supported (perhaps there's technical limitations); #63
The classic builder support this https://github.com/docker/cli/blame/2955ece0244307bdbb626ad2471024a51080ff1a/docs/reference/commandline/build.md#L108-L111, so for feature-parity, we should add support in BuildKit as well
myrepo.git
refs/heads/master
/
myrepo.git#mytag
refs/tags/mytag
/
myrepo.git#mybranch
refs/heads/mybranch
/
myrepo.git#pull/42/head
refs/pull/42/head
/
myrepo.git#:myfolder
refs/heads/master
/myfolder
myrepo.git#master:myfolder
refs/heads/master
/myfolder
myrepo.git#mytag:myfolder
refs/tags/mytag
/myfolder
myrepo.git#mybranch:myfolder
refs/heads/mybranch
/myfolder
The text was updated successfully, but these errors were encountered: