Jan 3, 2018 - /var/run/docker.sock is a Unix domain socket. Sockets are used in your favorite Linux distro to allow different processes to communicate with. You can communicate the host machine or even two containers using the same socket. In the general case of two containers, you should start the two dockers from the host machine sharing a volume that should be created in the host machine. Docker run --name 'containerA' -v /var/run/common_socket_dir:/var/run/common_socket_dir. Google doesn't work anymore. Docker run --name 'containerB' -v /var/run/common_socket_dir:/var/run/common_socket_dir. Both, containerA and containerB can now use sockets as /var/run/common_socket_dir/socketX to interconnect. Of course, the host machine could use the sockets in this volume to communicate with containers.
0 Comments
Leave a Reply. |