Docker Community Forums

Share and learn in the Docker community.

Docker share data between the containers

(Kaleeswaran Narayanan) #1

I’m using the docker version 1.10.3 . In that i want to access the data like ( /etc/java/configurations.yml ) from one container to another container using --link option . For example :

sudo docker run -d --name=test1 redis:latest

sudo docker run -d --link test1:test --name=test2 redis1:latest

i) test1 container has /etc/java/configurations.yml file.

ii) I want to access the above file from test1 to test2 container . Is it possible to do it.?

Your suggestions are highly appreciated and it would be helpful for me.

Kaleeswaran N

(Junius) #2

It is not possible for one container to directly access the file in another container. One option is the container exposes the files via such as NFS. Or both containers access the same volume.

By the way, --link will be deprecated. You should switch to use overlay network.