2

Docker allows a directory to be shared among other containers with the -v option.

But it shadows any existing directory on the host.

How can a host directory be made visible to the docker instance?

For example, this creates a mountpoint at /opt:

nvidia-docker run -i -t --name x nvidia/cuda:7.5-runtime-ubuntu14.04 -v /opt

But it shadows the host /opt. This is the safe, usually-desired behavior. But for development and instance setup, it would be immensely useful to have access to an existing file structure.

automorphic
  • 680
  • 7
  • 18

1 Answers1

2

In order to make your host files visible within your container, you need to specify:

<host_path>:<container_path>

So in your case:

docker run -it --name <whatever> -v /opt:/opt
B Faust
  • 234
  • 1
  • 6