I’m trying to get files from my container to my host by using bind mount, but the existing files from container side are not showing on my host side.
This is the empty directory on my host which I’m mounting:
/tmp/myapp
This is the container side of the mount:
/app
“/app” directory on the container already has files in it at the creation time of the bind mount and those are the files I want to receive on the host side of the volume, but the host side shows empty. Although if inside the container I move new files in the /app directory, they would show on the host side. So I’m confused why it doesn’t work on the existing files or is this really the way it’s supposed to work?
This is how the mount looks with docker inspect:
"Mounts": [
{
"Type": "bind",
"Source": "/tmp/myapp",
"Destination": "/app",
"Mode": "",
"RW": true,
"Propagation": "shared"
}