Summary
The user is inquiring about the tmpfs
type for RUN --mount
, noting a lack of documentation. They are questioning whether files written to tmpfs
would not be cached in a layer, suggesting it could be beneficial for test processes that generate a large amount of local content, which could otherwise inflate the cache.
joshua.gilman
Great explanation. Thank you!
vlad
Note that tmpfs is a RAM-based mount - it's only useful for small things. For bigger things you can use a cache mount (and you could generate a random cache ID each time if you want it to be temporary)
nacho
Contents in a cache mount are not cached in the layer. Also, they are not mounted as an overlayfs, that might relevant in terms of raw performance or if you want to use tooling that uses overlayfs on its on (overlayfs on top of overlayfs is not supported)
joshua.gilman
A related question, the tmpfs
type for RUN --mount
doesn't appear to have much in terms of documentation. Would files written here also not get cached in a layer? It may be helpful for some test processes that spit out a ton of local content that end up blowing up the cache.