Supposed I have a Docker container and a folder on my host /hostFolder
. Now if I want to add this folder to the Docker container as a volume, then I can do this either by using ADD
in the Dockerfile
or mounting it as a volume.
So far, so good.
Now /hostFolder
contains a sub-folder, /hostFolder/subFolder
.
I want to mount /hostFolder
into the Docker container (whether as read-write or read-only does not matter, works both for me), but I do NOT want to have it included /hostFolder/subFolder
. I want to exclude this, and I also want the Docker container be able to make changes to this sub-folder, without the consequence of having it changed on the host as well.
Is this possible? If so, how?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…