GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
14.94k stars 1.62k forks source link

Multistage Docker Build Cache #3831

Open no1melman opened 4 years ago

no1melman commented 4 years ago

Is the only way to support multistage docker build cache like discussed here to have separate docker builds in the skaffold build section like below (below being the skaffold rep of what is in that link):

build:
  artifacts:
    - image: itamarst/helloworld:compile-stage
      context: .
      docker:
        target: compile-image
        cacheFrom: 
          - itamarst/helloworld:compile-stage
    - image: itamarst/helloworld:latest
      context: .
      docker:
        target: runtime-image
        cacheFrom:
          - itamarst/helloworld:compile-stage
          - itamarst/helloworld:latest

There is no "auto" feature that scans your dockerfile first and caches necessary stages...

This seems bad to me for the reasons of tagging... if you have multiple CD pipelines running, they can't all read and write to helloworld:compile-stage, but if we left it up to the tag policy, how do you get that injected into the runtime-image stage

tstromberg commented 4 years ago

This seems like a reasonable idea - but also not a high priority for the team at the moment. If you or someone else is willing to make a design proposal, I'd be eager to check it out: https://github.com/GoogleContainerTools/skaffold/tree/master/docs/design_proposals

Help wanted!

no1melman commented 4 years ago

I would love to contribute to it, but I don't know Go, and currently not in a place to learn it. Hoping if there are any other awesome Go devs who could?

no1melman commented 4 years ago

Happy to jump on zoom calls and that to talk through it

tejal29 commented 4 years ago

@no1melman Please join skaffold-users@. We have a bi-weekly community office hours. More information here https://github.com/GoogleContainerTools/skaffold#community

If that does not work, please let us know and we can schedule something as per your convenience.

nkubala commented 4 years ago

@no1melman just FYI our next office hours is wednesday 06/24 at 9:30 AM PST!

no1melman commented 4 years ago

Yup I should be there.

nkubala commented 4 years ago

@no1melman would be great if you could provide a sample project that we can test this out on!