Skip to content

introduce cache-to#211

Merged
ndeloof merged 2 commits intocompose-spec:masterfrom
ndeloof:cache-to
Mar 1, 2022
Merged

introduce cache-to#211
ndeloof merged 2 commits intocompose-spec:masterfrom
ndeloof:cache-to

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Nov 8, 2021

What this PR does / why we need it:
Introduce cache-to in the compose specification, to offer a canonical binding with buildkit support for caching.

cc @CrazyMax @ulyssessouza @tonistiigi

@ndeloof ndeloof requested a review from ulyssessouza November 8, 2021 18:49
Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting this together - I got a general question to better understand the use case ❓

I can certainly see the value for a shared cache (e.g., on NFS or in the registry) being referenced by Compose via cache_from. What is the use case for specifying cache_to in Compose though? Something like a local path especially seems rather machine-specific and possibly better off left to the tooling (e.g., via some CLI interface or export command).

@ndeloof
Copy link
Collaborator Author

ndeloof commented Nov 19, 2021

cache_to supports allows to share layers from intermediary images in a multi-stage Dockerfile, which are not pushed with the main image. Also allows to configure cache mechanisms not based on image registry, like github actions cache.

@EricHripko
Copy link
Collaborator

Thank you for elaborating! I guess there's image, registry and inline caches that aren't machine-specific, strictly speaking 👍

Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a solid addition! Got a quick typo and a question inline 💬

@ndeloof
Copy link
Collaborator Author

ndeloof commented Nov 28, 2021

@EricHripko fixed, can I get your Approval on this one ?

Copy link
Contributor

@ulyssessouza ulyssessouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good once the typos inline are sorted ✅ Thank you for seeing this through 👍

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof merged commit ffd2294 into compose-spec:master Mar 1, 2022
@ndeloof ndeloof deleted the cache-to branch March 1, 2022 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants