Union mounted in docker containers

If I have a d1 / directory, I know that I can mount it in / mountPoint inside the Docker container by doing the following:

docker run -v /path/to/d1:/mountPoint ... 

However, I have two directories d1 / and d2 / (let's say they contain a.txt and b.txt files respectively).

I want to set the union of these two directories in / mountPoint in my container, i.e. I want /mountPoint/a.txt and / mountPoint / b.txt to exist.

Given that Docker uses UnionFS a lot, I rather hope that there are options for mounting the connection on a specific path inside the container, but I can not find them if that is the case.

+5
source share

Source: https://habr.com/ru/post/1244731/


All Articles