uber-archive / makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Apache License 2.0
2.41k stars 153 forks source link

Add options for read only cache #148

Open yiranwang52 opened 5 years ago

fkorotkov commented 5 years ago

BTW right now if no push registry provided via --push Makisu doesn't read from cache. Here is output that I see:

info    Starting Makisu build (version=v0.1.8)
info    Using build context: /makisu-context
info    Using http server at http://127.0.0.1:12321 for cacheID storage
info    No registry information provided, using cached layers
info    Found mapping in cacheID KVStore: 2c6a6013 => 6f2ff62d2d48b071e32208ef30a9214ca2fde599f4de2e5a31839d70e9fd8a52,698bf1c219611b1efbe4655a90aa600c99a427e64266c2f9b1f18c9079193622
error   Failed to fetch intermediate layer with cache ID 2c6a6013: registry client not configured to pull cache

Do you think it makes sense to introduce a pull registry to allow such read only behaviour? --pull flag will be consistent with --push flag? The value can also default to --push if no --pull explicitly provided. What do you think?

fkorotkov commented 5 years ago

I think this issue will require some breaking changes in flags. Right now --push flag is a bit confusing IMO. It tells which registry to use from --registry-config to push layers to.

I propose to rename --push to --registry, --registry-config to --registries-config. Then we can add --push flag with a new meaning to push layers. Or even better, --skip-push to opt out from pushing layers and only use the registry to pull layers.

How does it sound? I can work on a PR if the change makes sense.