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.88k stars 230 forks source link

Add support for --cache-from #279

Closed Chippiewill closed 4 years ago

Chippiewill commented 4 years ago

This adds support for docker build style --cache-from. It achieves this with two changes:

  1. img will always ask buildkit to export the build cache inline
  2. img will pass through --cache-from arguments

    205

AkihiroSuda commented 4 years ago
go build -tags "seccomp" -ldflags "-w -X github.com/genuinetools/img/version.GITCOMMIT=b5155e9 -X github.com/genuinetools/img/version.VERSION=v0.5.7" -o img .
client/controller.go:7:2: cannot find package "github.com/moby/buildkit/cache/remotecache/inline" in any of:
    /home/travis/gopath/src/github.com/genuinetools/img/vendor/github.com/moby/buildkit/cache/remotecache/inline (vendor tree)
    /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/github.com/moby/buildkit/cache/remotecache/inline (from $GOROOT)
    /home/travis/gopath/src/github.com/moby/buildkit/cache/remotecache/inline (from $GOPATH)
client/controller.go:8:2: cannot find package "github.com/moby/buildkit/cache/remotecache/registry" in any of:
    /home/travis/gopath/src/github.com/genuinetools/img/vendor/github.com/moby/buildkit/cache/remotecache/registry (vendor tree)
    /home/travis/.gimme/versions/go1.11.13.linux.amd64/src/github.com/moby/buildkit/cache/remotecache/registry (from $GOROOT)

needs revendor

codecov-io commented 4 years ago

Codecov Report

Merging #279 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #279   +/-   ##
=====================================
  Coverage       0%     0%           
=====================================
  Files          16     16           
  Lines         986   1006   +20     
=====================================
- Misses        986   1006   +20
Impacted Files Coverage Δ
build.go 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 79a3998...b754e37. Read the comment docs.

AkihiroSuda commented 4 years ago

Ideally we should support non-registry cache as well, but can be separate PR