Skip to content

Mounts: Change single file mounts to a different approach#665

Open
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:single-files-parent-dir
Open

Mounts: Change single file mounts to a different approach#665
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:single-files-parent-dir

Conversation

@dcantah
Copy link
Copy Markdown
Member

@dcantah dcantah commented Apr 8, 2026

Related to apple/container#1251

Change to sharing in the parent directory, and then bind mounting in the file into the container. This has the unfortunate reality of being less secure, but the current approach is burdended by a couple things, namely:

  1. You can't share in files that are on a different volume
  2. There is a Virtualization bug that causes spurious errors when trying to open the file.

I've added a doc to go over the approach we've taken, and some workarounds if the approach is not satisfactory.

Change to sharing in the parent directory, and then bind mounting
in the file into the container. This has the unfortunate reality
of being less secure, but the current approach is burdended by
a couple things, namely:

1. You can't share in files that are on a different volume
2. There is a Virtualization bug that causes spurious errors
when trying to open the file.

I've added a doc to go over the approach we've taken, and some
workarounds if the approach is not satisfactory.
@egernst egernst requested a review from crosbymichael April 9, 2026 01:18
Copy link
Copy Markdown
Contributor

@jglogan jglogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've approved, if you merge could you make another quick PR for the comments (or put them in another PR).

the behavior explicit and gives the container access to the full directory at the
destination path.

- **Stage files into a dedicated directory**: Copy or link the files you need into a
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy or hard link?

sharedParentTags.insert(prepared.tag)
let directoryShare = Mount.share(
source: prepared.parentDirectory.path,
destination: "/.file-mount-holding",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the comment back about this path being a dummy value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants