Using docker-compose
I'm trying to mount my working directory that contains multiple directories and some are symbolic links.
For instance, I want to mount my working directory that has directories A
, B
, and C
. However, directory C
is a symbolic link to C:\Users\MyUser\C
Therefore, I would mount my directories like so:
volumes:
- ../C:/mnt/host/c/Users/MyUser/C/ # Mounting to the symbolic link location
- ./:/usr/src/app # My working directory
This works fine. However, the issue is that c/Users/MyUser
is dependent on the user that is executing the command. Therefore, a user would have to go in and update the file to something like c/Users/SomeOtherUser
for it to still work. In other words, the directory I'm mounting it to is user dependent.
How can I decouple this from the User? It's fine to assume that the directory C
will be in the User's Home
directory and one level above the current directory. What I want to do is something like:
volumes:
- ../C:/mnt/host/${PWD}/../C/
However, this won't work as it's not a valid syntax. How can I mount a Volume to the Symbolic Link's location?