Is there any to way to communicate among docker containers other than via sockets/network? I have read docker documentation which says we can link docker containers using --link option but it doesn't speicify how to transfer data/msg from one container to another. I have already created a container named checkram.
Now I want to link a new container with this container and I run
docker run -i -t --privileged --link=checkram:linkcheck --name linkcont topimg
command.
Then i checked env variable LINKCHECK_PORT
in linkcont container which contains tcp://172.17.0.14:22.
I don't know what to do with this ip and port and how to communicate with checkram container from linkcont container. can anyone help me out of this? Thanks in advance.
Asked
Active
Viewed 1,231 times
1

errordeveloper
- 6,716
- 6
- 41
- 54

user3550166
- 129
- 2
- 14
-
that's not a question about programming and is much better suited for https://serverfault.com/ – JimiDini Oct 31 '14 at 10:43
-
1What kind of "communication" do you want? – Thomas Orozco Oct 31 '14 at 10:47
-
data should be exchanged among containers but not through sockets..whether it can be IPC or some other means..is it feasible? – user3550166 Oct 31 '14 at 10:48
-
@user3550166 No, not really. See this related question: http://stackoverflow.com/questions/23889187/is-it-possible-to-share-memory-between-docker-containers – Thomas Orozco Oct 31 '14 at 11:09
-
You could use volumes to mount the same volume in both containers and then write from one and read from the next. I am not sure of how efficient this model is but it allows you to communicate without using sockets. – Usman Ismail Oct 31 '14 at 20:34
-
@usman-but is that one way communication? – user3550166 Nov 01 '14 at 20:56
-
No, it is not. You can also mmap files from volumes, use BSD sockets or other stuff. It really depends on what kind of communication you want. Using TCP with netcat is reasonably easy as well. – andi5 Nov 02 '14 at 18:24
1 Answers
0
There are several tools you can use to achieve running multiple docker containers and interact with them. docker has a tool: docker Compose where you can build and interact multiple containers.
Another tool that works as well: decking you can also use FIG, but i found decking was very straight forward and easy to configure. At that time when i was using decking, docker compose was not released yet. docker compose is a newer tool, yet it is developed by docker.

AL-Tamimi
- 672
- 5
- 9
-
if you chose to use decking, then you will use decking to pass the environment variables to docker containers as parameters – AL-Tamimi Feb 03 '16 at 14:25