0

I have created a container with a name of "tensorflow-syntaxnet_container" using docker command docker run -d -name tensorflow_syntaxnet_container syntaxnet_image and the other container "python_flask" with linking the tensorflow-syntaxnet_container using docker command docker run -d -p 0.0.0.0:5001:5001 --link tensorflow-syntaxnet_container:syntaxnet -name python_flask python_image:latest and both the containers are create successfully and its working as expected individually.

Also verified that python_flask container lined with syntaxnet container as cat /etc/hosts results 172.17.0.27 syntaxnet e002ab9f43a7 tensorflow-syntaxnet_container which is container ip of syntaxnet container.

i need call a script file demo.sh and need to access output file in connect with tensorflow-syntaxnet_container from my python flask application located at python_flask container

i could not find any mount directory or folder of linked container tensorflow-syntaxnet_container

Could any one can help me out how to call the script file and access all file from one container to another

gopinath
  • 155
  • 1
  • 1
  • 8

2 Answers2

1

Linking two containers enables network communication. What you want are volumes: https://docs.docker.com/engine/tutorials/dockervolumes/#/creating-and-mounting-a-data-volume-container

Martin
  • 2,754
  • 1
  • 15
  • 35
1

Check it here Docker Link Docks and here Docker Volume Docs

With --link you only can link network interfaces of container. If you want to share filesystem, you will, probably, need --volumes-from.

docker create -v /path/to/script/dir --name scriptstore image1:name
docker run -d --volumes-from scriptstore --name runner image2:name bash /path/to/script/dir/scriptname.sh
Evedel
  • 653
  • 5
  • 18