-
Notifications
You must be signed in to change notification settings - Fork 58
Determine default cache map from Dockerfile #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine default cache map from Dockerfile #49
Conversation
Signed-off-by: bennesp <[email protected]>
Signed-off-by: bennesp <[email protected]>
8a21fcd to
ff982a4
Compare
omus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Signed-off-by: bennesp <[email protected]>
Signed-off-by: bennesp <[email protected]>
395734c to
9b9fed1
Compare
Signed-off-by: bennesp <[email protected]>
Signed-off-by: bennesp <[email protected]>
Signed-off-by: bennesp <[email protected]>
dba22cf to
429cead
Compare
|
@AkihiroSuda do you think you could kindly take a look at this PR? 🙏 |
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
Next time please consider squashing commits |
|
Thank you for the quick response, I will squash next time! |
Closes #48 (thank you @omus for sharing a very useful code snippet)
This PR allows users to avoid specifying cache-map: the cache-map will be automatically created by inspecting the AST of the Dockerfile. Of course, users can continue specifying cache-map, in situations where users need more control.
Users can specify a Dockerfile of their choice with the
dockerfileoption.For each cache mount, the respective generated cache-map entry is the following:
idof the cache mount if specified, otherwise thetargetof the cache mountExample:
This dockerfile will generate the following cache-map:
{ "/tmp/cache": { "id": "/tmp/cache", "target": "/var/cache-target" }, "cache1": { "id": "cache1", "target": "/var/cache-target" }, "cache2": { "id": "cache2", "target": "/var/cache-target" }, "cache3": { "id": "cache3", "target": "/var/cache-target" } }