You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kaniko can cache layers created by RUN and COPY (configured by flag --cache-copy-layers) commands in a remote repository
This makes it sound like either all RUN and COPY commands are always cached, or they're not, depending on if --cache-copy-layers is set.
Most people reading this are probably already aware that according to docker's cache page, RUN commands are always cached, as long as the command itself in the dockerfile hasn't changed, and COPY commands store file hashes along with the image, and only invalidate the cache if the files being copied changed.
Is this how kaniko works WITHOUT the --cache-copy-layers flag? Is this how kaniko works WITH the --cache-copy-layers flag? Or does Kaniko work completely differently than how docker works, and either enables or disables caching of RUN and COPY commands, without using file hashes for the COPY command, or string comparisons for the RUN command?
The text was updated successfully, but these errors were encountered:
Agreed, the README is a bit misleading at the moment.
In terms of what this flag actually does, there is context #1408 and #1518.
It looks like the flag only has to do with the COPY command, no? I think the README may be misleading / inaccurate in mentioning RUN in the context of --cache-copy-layers. In fact the flag name suddenly makes a lot more sense if it's only talking about COPY and not RUN.
It's probably just a grammatical issue. If you look at this commit, it probably meant kaniko can cache layers created by RUN (and COPY, configured by flag --cache-copy-layers) commands in a remote repository instead of kaniko can cache layers created by RUN and COPY (configured by flag --cache-copy-layers) commands in a remote repository (notice the location of the left bracket).
This isn't exactly a bug report. Just a question, with maybe a suggestion for some additional documentation.
According to the caching section of the kaniko README:
This makes it sound like either all
RUN
andCOPY
commands are always cached, or they're not, depending on if--cache-copy-layers
is set.Most people reading this are probably already aware that according to docker's cache page,
RUN
commands are always cached, as long as the command itself in the dockerfile hasn't changed, andCOPY
commands store file hashes along with the image, and only invalidate the cache if the files being copied changed.Is this how kaniko works WITHOUT the
--cache-copy-layers
flag? Is this how kaniko works WITH the--cache-copy-layers
flag? Or does Kaniko work completely differently than how docker works, and either enables or disables caching ofRUN
andCOPY
commands, without using file hashes for theCOPY
command, or string comparisons for theRUN
command?The text was updated successfully, but these errors were encountered: