call a script file from one docker container to another container using –link container
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
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
2 Solutions collect form web for “call a script file from one docker container to another container using –link container”
Check it here Docker Link Docks
and here Docker Volume Docs
--link you only can link network interfaces of container. If you want to share filesystem, you will, probably, need
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
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