Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mount path resolving in example_wrapper.sh #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pum1k
Copy link

@pum1k pum1k commented Nov 14, 2024

This pull request resolves the following issue, where mounting a symlink using the example wrapper results in unexpected bahaviour.

If I have a symlink /path/to/symlink/ that points to directory /path/to/dir/ and try to mount it into the container by adding

"type=bind" "/path/to/symlink/" "/path/to/symlink/"

to the MOUNTS variable, I would assume that the path inside container will be /path/to/symlink/. However, the symlink is resolved and it is placed into /path/to/dir/ instead.

This problem is even more strange, when the target corresponds to a random symlink inside the host system - the symlink is resolved and as a result, the mount is placed into a seemingly random location.

My fix disables resolving of symlinks for the target mount point as they are not relevant to the file system inside of the container. (Symlinks for the source directory are still resolved.)

This also fixes problems with X11 apps not working under some versions of WSL2, where /tmp/.X11-unix/ is symlink.

Example wrapper no longer resolves symlinks when preparing path of destination mount point.
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