Skip to content
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 patch for buildkit to fetch by commit #742

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

yosifkit
Copy link
Contributor

@yosifkit yosifkit commented Jun 24, 2024

Quick patch to get buildkit to attempt to fetch by digest.

Edit by @tianon: this is now simply a backport of moby/buildkit#5441 👀 🥳

@tianon
Copy link
Owner

tianon commented Jun 25, 2024

(rebased, especially for #744)

@tianon
Copy link
Owner

tianon commented Oct 30, 2024

Looks like we need to do some testing of moby/buildkit#5441! 👀

@tianon
Copy link
Owner

tianon commented Oct 30, 2024

Rebased for 38eb63e, but now I'm going to update this to be a backport of moby/buildkit#5441 instead 👀

Edit: saving 7274d12...612102b for posterity (the original patch without the rebase noise; "thanks GitHubama")

@tianon tianon force-pushed the fetch-by-commit branch 2 times, most recently from ec5ad05 to abdb80c Compare October 31, 2024 22:07
@tianon
Copy link
Owner

tianon commented Oct 31, 2024

Ok, there's a backport for 0.13, now to rebase on master to pick up the latest releases again 😭

@tianon
Copy link
Owner

tianon commented Oct 31, 2024

Yesssssssss!!!! 🎉

$ docker buildx build --builder old --pull 'https://github.com/docker-library/mysql.git#e0d43b2a29867c5b7d5c01a8fea30a086861df2b:8.0' -f Dockerfile.oracle
#0 building with "old" instance using docker-container driver

#1 [internal] load git source https://github.com/docker-library/mysql.git#e0d43b2a29867c5b7d5c01a8fea30a086861df2b:8.0
Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
fatal: Not a valid object name e0d43b2a29867c5b7d5c01a8fea30a086861df2b^{commit}
From https://github.com/docker-library/mysql
 * branch            e0d43b2a29867c5b7d5c01a8fea30a086861df2b -> FETCH_HEAD
#1 DONE 0.9s

#2 [internal] load metadata for docker.io/library/oraclelinux:8-slim
#2 ...

@tianon
Copy link
Owner

tianon commented Oct 31, 2024

Nice, fallback appears to work fine too:

$ docker buildx build --builder old --pull 'https://github.com/docker-library/mysql.git#ffffffffffffffffffffffffffffffffffffffff:8.0' -f Dockerfile.oracle
#0 building with "old" instance using docker-container driver

#1 [internal] load git source https://github.com/docker-library/mysql.git#ffffffffffffffffffffffffffffffffffffffff:8.0
fatal: Not a valid object name ffffffffffffffffffffffffffffffffffffffff^{commit}
fatal: remote error: upload-pack: not our ref ffffffffffffffffffffffffffffffffffffffff
From https://github.com/docker-library/mysql
 * [new branch]      jq-IN      -> origin/jq-IN
 * [new branch]      master     -> origin/master
fatal: reference is not a tree: ffffffffffffffffffffffffffffffffffffffff
#1 ERROR: failed to checkout remote https://github.com/docker-library/mysql.git: git error: exit status 128
stderr:
fatal: reference is not a tree: ffffffffffffffffffffffffffffffffffffffff

------
 > [internal] load git source https://github.com/docker-library/mysql.git#ffffffffffffffffffffffffffffffffffffffff:8.0:
fatal: Not a valid object name ffffffffffffffffffffffffffffffffffffffff^{commit}
fatal: remote error: upload-pack: not our ref ffffffffffffffffffffffffffffffffffffffff
From https://github.com/docker-library/mysql
 * [new branch]      jq-IN      -> origin/jq-IN
 * [new branch]      master     -> origin/master
fatal: reference is not a tree: ffffffffffffffffffffffffffffffffffffffff
------
ERROR: failed to solve: failed to read dockerfile: failed to checkout remote https://github.com/docker-library/mysql.git: git error: exit status 128
stderr:
fatal: reference is not a tree: ffffffffffffffffffffffffffffffffffffffff

@tianon tianon merged commit e2f68bf into tianon:master Oct 31, 2024
57 checks passed
@yosifkit yosifkit deleted the fetch-by-commit branch November 4, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants