E

Inquiry about RUN --mount and caching

Summary

The user is inquiring about using RUN --mount or a CLI flag to mount a local directory to the build context, seeking to avoid issues with SAVE ARTIFACT AS LOCAL. They are interested in the technical limitations and the impact on layer caching, particularly noting that mounting secrets as files does not seem to allow for caching. The user acknowledges the option of using LOCALLY but points out its drawbacks, such as lack of isolation, inability to inherit from images for necessary tools, and the permanence of installations. They propose a scenario where a release process managed in an Earthly target could utilize a mount to operate on the local workspace without executing commands directly on the host machine, highlighting potential confusion regarding the context of the mount.

Status
resolved
Tags
    Source
    #earthly
      p

      pjbecotte

      8/10/2024

      Remember the host where the earthly cli runs is not necessarily the one where the buildkit daemon is running- it could be very unclear ehat a "mount" means in this context.

      j

      joshua.gilman

      8/9/2024

      Imagine a release process that is managed in an Earthly target. Something like:

      earthly --mount /home/runner/workspace:/work +release Where +release contains all of the tools it needs to complete the release process and can operate on the local workspace without actually running commands directly on the host machine.

      j

      joshua.gilman

      8/9/2024

      Hey <@U035VU5K46Q>,

      Thanks. I knew about LOCALLY, but it removes some of the benefits here, namely:

      • There's no longer isolation between Earthly and the host • Earthly cannot inherit from an image to pull in tools it needs • Installing anything under LOCALLY is permanent and undesirable on the user end

      n

      nacho

      8/9/2024
      j

      joshua.gilman

      8/9/2024

      It appears there's some sort of rudimentary mounting support with RUN --mount. Is there a technical limitation to using this (not necessarily via RUN but maybe a CLI flag) to mount a local directory to the build context? I'm not sure how it would interact with layer caching (it appears mounting secrets as files doesn't result in caching). Use case being modifying a local folder without going through the pain of SAVE ARTIFACT AS LOCAL.