fix(hooks): mount cargo target outside bind mount via CARGO_TARGET_DIR #37
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dev-371-precommit-host-owned-target"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Mount the pre-commit cargo target cache at
/cargo-target(outside the/buildbind mount) and point cargo at it withCARGO_TARGET_DIR=/cargo-target, instead of nesting the named volume at/build/target. The volume name is unchanged, so the cache still persists.Why (DEV-371)
Nesting the named
dev-explorer-bookmarks-cargo-targetvolume at/build/target, under the/buildhost bind mount, makes the Docker daemon create a root-ownedtarget/directory on the host that needssudoto remove. Moving the mount path off the bind mount stops the root-owned dir from appearing.Note
Follows the governance Option A standard: cargo target volume mounted outside the bind mount with
CARGO_TARGET_DIRset.