title: Using a local network Docker registry server
body: <p>I'm testing the new Docker 1.12 swarm mode.  </p>
  
  <p>I have 2 VMs running docker.  One is set up and running my containers.  The other docker is brand new.</p>
  
  <p>I would like to set up the new one with the same images that are set up on docker machine 1.  </p>
  
  <p>The default option is to WinSCP the files over, rebuild the dockerfiles on the new machine, and run them.</p>
  
  <p>But I assume the correct way to do it is to push my images to a private docker repository, and pull the images on the second docker machine, right?</p>
  
  <p>If I push the images on Docker machine 1, how do I set up Docker machine 2 to connect to the first's registry, to pull the image?</p>
  
  <p>Also, is this necessary in order to run swarm mode, or by connecting to the overlay network of the Docker machine 1, will it automatically use the remote registry on Docker machine 1, to pull the images to be replicated?</p>
  
  <p>I'm on RHEL Centos 7, latest docker 1.12.3
  I've tried a few things:</p>
  
  <pre><code>docker pull dockermachineOne:5000/djb/eap:6.3.0
  
  Error response from daemon: Get https://dockermachineOne:5000/v1/_ping: http: server gave HTTP response to HTTPS client
  
  docker pull --insecure-registry=http://dockermachineOne:5000 djb/eap:6.3.0
  
  unknown flag: --insecure-registry
  </code></pre>
  
  <p>Seems like a critical sort of bug.</p>