I have two Dart applications I need to dockerize. These two apps use a shared source directory.
Because Docker prevents adding files from folders outside the context directory (project/app1
) I can't add files from ../shared
nor from shared
(the symlink inside projects/app1
).
I'm looking for a way to trick Docker to do it anyway.
My simplified project structure
- projects
- app1
- Dockerfile
- shared (symlink ../shared)
- otherSource
- app2
- Dockerfile
- shared (symlink ../shared)
- otherSource
- shared
- source
I could move Dockerfile
one level up and run docker build
from there but then I need two Dockerfiles (for app1 and app2) in the same directory.
My current idea was, if I could somehow hide the fact that projects/app1/shared
is a symlink this problem would be solved.
I checked if I can share projects
using Samba and remount it somewhere else and configure Samba to treat symlinks like normal folders but haven't found whether this is supported (I have not much experience with Samba and not tried it yet, just searched a bit).
Is there any other tool or trick that would allow that?
I would rather not change the directory structure because this would cause other troubles and also rather not copy files around.