title: Docker push takes a really long time
body: <p>I have a deployment setup with Docker that works as follows:</p>
  
  <ol>
  <li>Build an image on my dev machine via a Dockerfile</li>
  <li>Push the image to a registry (I tried both Docker Hub and Quay.io)</li>
  <li>Pull this image to the deployment server, and restart the container.</li>
  </ol>
  
  <p>I'd like to do these steps as quickly as possible, but they take an incredibly long time. Even for an image of modest size (750MiB, including the standard <code>ubuntu</code> and friends), after a small modification, it takes <strong>17 minutes</strong> to deploy. I optimized the order of items in my <code>Dockerfile</code>, so it actually hits the cached images most of the time. This doesn't seem to make a difference.</p>
  
  <p>The main culprit is the <code>docker push</code> step. For both Docker Hub and Quay.io, it takes an unrealistically long time to push images. In one simple benchmark I did, I executed <code>docker push</code> twice back to back, so all the previous images are already on the registry. So I only see these lines:</p>
  
  <pre><code>...
  bf84c1d841244f: Image already pushed, skipping
  ...
  </code></pre>
  
  <p>But if I time the push, the performance is horrendous. Pushing to Quay.io takes <strong>3.5 minutes</strong> when all the images are already on the server! Pushing to Docker Hub takes about <strong>12 minutes</strong>!</p>
  
  <p>There is clearly something wrong somewhere, since many people are using Docker in production, these times are exactly the opposite of continuous delivery.</p>
  
  <p>How can I make this run quicker? Do others also see this kind of performance? Does it have to do with the registry services, or somehow related to my local machine?</p>
  
  <p>I am using Docker under Mac OS X.</p>