What is the correct way too handle project symlinks?

What is the correct way too handle project symlinks?

When running the instance via docker run -it --init -p 3000:3000 --expose 9229 -p 9229:9229 -v “$(pwd):/home/project:cached” theiaide/theia:next --inspect= most of the project host mounts correctly. However, any symlinks that exist on the host do not resolve inside the container as the symlink itself uses the host file path.

From the container:
lrwxr-xr-x 1 theia theia 33 Jan 14 18:25 dtos -> /Users/zxzxzxzxz/mystuff/thing/dtos

[original thread by Jack Murphy]

@marc-dumais maybe you know?

Hi @rightisleft. Using a mounted host volume in your container is a quick way to try/demo a Theia image with an existing project, but it may not be the best way. Permissions are often a headache (unless you setup a user with same uid/gid in the container as on the host). Another concern, this one about symlinks, is that the file watcher we use in Theia does not handle symlinks gracefully, leading to subtle issues.

If you want to experiment, from what I understand, the way to make such symlinks resolve correctly is to also mount the referred directory(ies) in the image, at the same path. So for the example above, you might try to also mount “dtos” at path “/Users/zxzxzxzxz/mystuff/thing/” as part of the “docker run” command.

See: https://stackoverflow.com/questions/38485607/mount-host-directory-with-a-symbolic-link-inside-in-docker-container/40322275#40322275