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 some way to get the sha256 digest of the image #1158

Closed
sindreij opened this issue Aug 30, 2019 · 7 comments · Fixed by #2095
Closed

Add some way to get the sha256 digest of the image #1158

sindreij opened this issue Aug 30, 2019 · 7 comments · Fixed by #2095

Comments

@sindreij
Copy link

We are looking into using this instead of kaniko for building our images. Kaniko has --digest-file to get the digest of the built image. Is there some way of doing this with buildkit and buildkitctl? It looks like we can try to get the digest from the build-log, but that looks like a hacky solution.

@tonistiigi
Copy link
Member

if you use https://github.com/docker/buildx with buildkit you can use --iidfile for this. It is not exposed in buildctl atm. but supported in api.

@sindreij
Copy link
Author

How is the support for running buildx in a docker container in kubernetes. Does it work without docker? Would you accept a PR to save the metadata in resp.ExporterResponse (where this is in buildctl) to a file?

@tonistiigi
Copy link
Member

buildx currently has docker-container and docker daemon driver. direct k8s driver is not currently implemented but would be accepted docker/buildx#22 .

For buildctl I'm not against it but as buildctl is designed to be more like generic reference cli implementation, maybe the flag should be --metadata-file where it would write all the metadata in resp.ExporterResponse. @AkihiroSuda wdyt?

@sindreij
Copy link
Author

I'd like to start the daemon manually, and then have buildx inside a k8s-pod using that, do you know if that is possible with buildx?

The --metadata-file flag sounds like a great solution for our use case.

@tonistiigi
Copy link
Member

I'd like to start the daemon manually, and then have buildx inside a k8s-pod using that, do you know if that is possible with buildx?

That's not possible in current buildx. Would need a separate driver. The current driver starts the buildkit container itself as part of the build flow.

@AkihiroSuda
Copy link
Member

related: #993

@tonistiigi
Copy link
Member

@AkihiroSuda for #993 we probably would need a special option that cli(or exporter) understands. these requirements seem very specific.

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 a pull request may close this issue.

3 participants