GoogleContainerTools / GoogleContainerTools/skaffold

Multistage Docker Build Cache

Open
#3,831 7 comments 0 reactions 0 assignees View on GitHub
area/build area/cache build/docker kind/feature-request priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Is the only way to support multistage docker build cache like discussed [here](https://pythonspeed.com/articles/faster-multi-stage-builds/) to have separate docker builds in the skaffold build section like below (below being the skaffold rep of what is in that link):

```yaml
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.