0

I created a docker container that is already running a the bash.

$ docker run -ti ubuntu bash

In a new terminal I check for the running containers:

$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

354449b423e1 ubuntu "bash" About a minute ago Up About a minute backstabbing_mestorf

Now I want to mount a drive that I have shared already on the running container without committing and creating a new image, neither pausing nor stopping it.So, I know

$ docker run ti -v /SrcDir:/Dest bash

The command above will create a new container but I don't want that. Is there a way where I will be able to mount and eject volumes from the host onto a running container?

vibhuyadav
  • 11
  • 4
  • 1
    There's a blog post about that here [Attach a volume to a container while it is running](https://jpetazzo.github.io/2015/01/13/docker-mount-dynamic-volumes/). – Roman Nov 29 '16 at 19:11
  • From nsenter's readme - Caveats - nsenter still needs to run from the host; it cannot run inside a container (yet). It still seems you need to start the container using docker-enter. – vibhuyadav Nov 30 '16 at 17:12
  • docker-enter starts a new container in the same context as your existing container. It's like `docker exec` before there was a docker exec. What you are asking to do is technically possible but inadvisable (outside of a learning exercise). – Roman Nov 30 '16 at 18:15

0 Answers0