E

Inquiry about tmpfs for RUN --mount

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.

Status
resolved
Tags
  • RUN --mount
  • tmpfs
  • documentation
  • RUN --mount
  • tmpfs
Source
#earthly
    j

    joshua.gilman

    8/9/2024

    Great explanation. Thank you!

    v

    vlad

    8/9/2024

    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)

    n

    nacho

    8/9/2024

    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)

    j

    joshua.gilman

    8/9/2024

    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.