title: IPC communication between Docker containers
body: <p>Is it possible for two separate Docker containers to communicate over a ZMQ IPC socket? If so, how can this be achieved?</p>
  
  <p>For example:</p>
  
  <blockquote>
    <p><strong>Docker Container #1</strong> executes an application that creates a ZMQ Response socket and binds to "ipc://tmp/service_name".</p>
    
    <p><strong>Docker Container #2</strong> executes an application that creates a ZMQ Request socket and connects to "ipc://tmp/service_name".</p>
  </blockquote>
  
  <p>The following commands are used to run the applications in two separate docker containers:</p>
  
  <pre><code>// Run container #1 (binds to "ipc://tmp/service_name")
  docker run --name c1 -it container1
  
  // Run container #2 (connects to "ipc://tmp/service_name")
  docker run -it --link c1:container1 --name c2 container2
  </code></pre>
  
  <p>After running the containers, I am not able to establish the ZMQ (IPC) connection. However, I am able to ping container 1 from container 2, and ping container 2 from container 1. </p>
  
  <p>I also tried using the --ipc command, but it did not help:</p>
  
  <pre><code>// Run container #1 (binds to "ipc://tmp/service_name")
  docker run --name c1 --ipc=host -it container1
  
  // Run container #2 (connects to "ipc://tmp/service_name")
  docker run -it --link c1:container1 --ipc=container:c1 --name c2 container2
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  I am able to communicate between two separate Docker containers using a ZMQ TCP socket, but am still unable to communicate using an IPC socket. Is it possible?</p>