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 git source #63

Merged
merged 5 commits into from
Jul 11, 2017
Merged

Add git source #63

merged 5 commits into from
Jul 11, 2017

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Jul 10, 2017

fixes #36

This PR adds a git source with optimized fetching and commit sha based caching. It uses one shared repository per remote, updates it when needed and checks out the commit current build needs.

One of the issues found when implementing this was that some projects expect .git directory for detecting the current version. I currently solved it with a keepgitdir option but it is not very clean.

Another slight problem is that the current git identifier syntax doesn't support setting a branch/tag and a commit sha on the same time(unlike image reference for example). This means that when commit sha is used we need to pull all commits of all remote references, and if branch/tag is used we need to resolve it every time to check that it has not changed for the cache hit. I wonder if it would be safe to assume that tags are immutable for the cache.

I also added support for llb.Scratch() as I needed it for modified example. I also added back the older versions of buildkit example to show how they have changed.

@AkihiroSuda

@AkihiroSuda
Copy link
Member

Let's merge this PR before #65

LGTM but

  • needs rebase
  • Please put description about differences across buildkit[0-2] in examples/README.md?

@tonistiigi
Copy link
Member Author

@AkihiroSuda updated

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Add git source
2 participants