genuinetools / img

Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder.
https://blog.jessfraz.com/post/building-container-images-securely-on-kubernetes/
MIT License
3.9k stars 231 forks source link

Cache import/export support #300

Closed swrap closed 4 years ago

swrap commented 4 years ago

Added in support to utilize moby/buildkit import-cache and export-cache fields. Updated the README to include all the information about the new fields. Thanks to @Chippiewill for all the help that he did through his #279 PR, really made this addition a lot easier. This is to support #263 and all to add the ability to utilize more caching by being able to export some cache! Also thanks to #287, helped me understand more by providing a better explanation for the README.

Let me know if anything needs changes! First time committing in this repo, so please be kind especially if I made any silly mistakes.

AkihiroSuda commented 4 years ago

Can we rather use cache-from and cache-to as in buildx? https://github.com/docker/buildx#--cache-fromnametypetypekeyvalue

Also please squash commits

swrap commented 4 years ago

Can we rather use cache-from and cache-to as in buildx? https://github.com/docker/buildx#--cache-fromnametypetypekeyvalue

Also please squash commits

Are those just a different naming convention for export-cache and import-cache or do they act differently? Have not really used buildx, so I am not familiar with the similarities/differences. I think they are, after looking through some src code, this is where the ops are changed over.

Yes I can squash.

AkihiroSuda commented 4 years ago

Just different convention

swrap commented 4 years ago

A little bit of a problem, #279 created cache-from to mimic the docker build cache-from and always run as inline. I think I will make changes to always consider inline unless otherwise specified. Your thoughts?

AkihiroSuda commented 4 years ago

Sgtm