3

I have a docker container which mounts volume using -v /host/path:/docker/path

This mounts overwrites (shadows) the files inside the container. I would now like to copy the original files from inside the container into the mounted volumes. For this I need to access the shadowed files.

The common way of doing this seems to be mount --bind. But to use this, I would need the leverage my privileges inside the docker container and I would rather not do that.

Is there another way of accessing this shadows files that is doable from inside the docker container?

Update

A little bit about the background (in response to comments): I want to initialize the mounted volume with the contents inside the docker image. That is standard behavior of docker when using named volumes. Unfortunately that does not seem to be possible in ECS (which is where I start the container).

  • This seems broken in many ways. If you need access to both sets of files at the same time, then move one set to a different location. – EEAA May 4 '17 at 13:14
  • I want to initilize the mounted volume with the contents inside the docker image. That is standard behavior of docker when using named volumes. Unfortunately that does not seem to be possible in ECS (which is where I start the container). – Nathan May 4 '17 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.