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.
pjbecotte
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.
joshua.gilman
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.
joshua.gilman
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
nacho
Hi Josh, another option would be using https://docs.earthly.dev/docs/earthfile#locally|LOCALLY. FYI related discussion: https://github.com/earthly/earthly/issues/1139
joshua.gilman
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
.