Skip to content

git: add git bundle source support#6711

Merged
tonistiigi merged 2 commits intomoby:masterfrom
tonistiigi:git-bundle-support
May 4, 2026
Merged

git: add git bundle source support#6711
tonistiigi merged 2 commits intomoby:masterfrom
tonistiigi:git-bundle-support

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

Support importing git sources from OCI or registry-backed bundle blobs and exporting resolved checkouts as single-file git bundles.

Comment thread source/git/bundle.go
Comment thread client/llb/source.go
} else {
attrs[pb.AttrMountSSHSock] = gi.MountSSHSock
}
addCap(&gi.Constraints, pb.CapSourceGitMountSSHSock)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still wires SSH even when GitBundleURL(...) is set? Maybe we should add an extra cond:

Suggested change
if remote != nil && remote.Scheme == gitutil.SSHProtocol && gi.Bundle == "" {
if gi.KnownSSHHosts != "" {
attrs[pb.AttrKnownSSHHosts] = gi.KnownSSHHosts
} else {
keyscan, err := sshutil.SSHKeyScan(remote.Host)
if err == nil {
// best effort
attrs[pb.AttrKnownSSHHosts] = keyscan
}
}
addCap(&gi.Constraints, pb.CapSourceGitKnownSSHHosts)
if gi.MountSSHSock == "" {
attrs[pb.AttrMountSSHSock] = "default"
} else {
attrs[pb.AttrMountSSHSock] = gi.MountSSHSock
}
addCap(&gi.Constraints, pb.CapSourceGitMountSSHSock)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably sending the cap is still correct as the SSH URL is still sent and tracked. Bundle URL does not replace the identifier URL, but becomes an extra transport option on top of it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right still need to preserve source identity and SSH attrs may still be relevant later, like for submodules

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was trying to point that bundle mode can force SSH forwarding even before we have any reason to contact the SSH remote

Support importing git sources from OCI or registry-backed bundle blobs
and exporting resolved checkouts as single-file git bundles.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@crazy-max crazy-max added this to the v0.30.0 milestone May 4, 2026
@tonistiigi tonistiigi merged commit 80fe7f0 into moby:master May 4, 2026
192 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants