Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

plugin/docker: add no-cache option #2953

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

radriaanse
Copy link
Contributor

Allow to pass through the no-cache flag to disable the build cache.

This is useful in cases where you want to make sure you're doing a clean build or to mitigate issues with the build cache that arise from time to time.

@radriaanse
Copy link
Contributor Author

Verified it's working, default behavior stays the same (cache is used):

» Building nocache...
-> Initializing Docker client...
-> Building image...
Step 1/2 : FROM scratch
 --->
Step 2/2 : COPY . .
 ---> Using cache
 ---> c124aba5ef06

And after setting to true the build log shows no cached layers are used:

» Building nocache...
-> Initializing Docker client...
-> Building image...
Step 1/2 : FROM scratch
 --->
Step 2/2 : COPY . .
 ---> c124aba5ef06
Successfully built c124aba5ef06

Also tested with buildkit, seems to work just fine as well but can't verify using logs since those are broken.

@briancain briancain requested a review from a team January 28, 2022 23:55
Copy link
Contributor

@krantzinator krantzinator left a comment

Choose a reason for hiding this comment

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

Look fine to me, thank you!
A nit that doesn't pertain to this PR specifically is that we should probably update the buildWithDocker func to take in options; it's getting a bit unwieldy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants