Docker Community Forums

Share and learn in the Docker community.

Conceptual Struggle: how does a docker container interact with a Virtual Machine?


(Anthony R. Colombo) #1

Hello.

First I am running a virtual machine linux box that has docker installed, and when I need to use Linux, I push linux containers locally and pull them onto the linux VM.

Here is my question: “How does a docker container gain access to the virtual machine directories/folders?”

If I am ssh’d into my virtual machine, I have my own hierarchy of folders.
If I run my docker container interactively, this container has its own hierarchy of folders.

The problem: What if I have a script in my container, that needs to process a file on my virtual machine?

I know that you can mount a volume of a local directory, and build the container, then the container has access to the local directory as a volume.

Can you mount a volume AFTER you built a docker container? can I build the docker container, and afterward add the volume?

thank you very much


(Anthony R. Colombo) #2

this I found helpful

https://docs.oracle.com/cd/E52668_01/E54669/html/section_vtr_p2z_fp.html