Linux – communication between containers in docker other than sockets/network

containersdockerlinux

Is there any to way to communicate among docker containers other than via sockets/network? May be it can be IPC or some other means. Is it feasible?

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.

Best Answer

The --link option provides a way for containers on the same machine to find each other, given that IP addresses are assigned dynamically and ports can be re-mapped. However, it is all about socket communication. The idea is that you would be running a program in one container listening on a socket, and you would run another program in the other container that would connect up to the first socket.

Docker (and linux containers in general) is all about isolating one thing from another, so IPC mechanisms such as shared memory are not available.