title: Super-slow Elastic Beanstalk Docker Deployments
body: <p>I'm deploying a Docker app on Elastic Beanstalk.  It works, but takes forever (30 minutes until it's back in the "green" state).  On my development environments, it finishes within a few seconds.  SSHing into the production instance and tailing the logs (/var/log/eb-activity.log), I see that it hangs on the starred line below (running 03build.sh):</p>
  
  <pre><code>[2016-05-23T13:10:00.430Z] INFO  [3199]  - [Application deployment app-160523_130556@23/StartupStage0/AppDeployPreHook/02loopback-check.sh] : Starting activity...
  [2016-05-23T13:10:07.845Z] INFO  [3199]  - [Application deployment app-160523_130556@23/StartupStage0/AppDeployPreHook/02loopback-check.sh] : Completed activity.
  *****[2016-05-23T13:10:07.845Z] INFO  [3199]  - [Application deployment app-160523_130556@23/StartupStage0/AppDeployPreHook/03build.sh] : Starting activity... 
  [2016-05-23T13:31:58.805Z] INFO  [3199]  - [Application deployment app-160523_130556@23/StartupStage0/AppDeployPreHook/03build.sh] : Completed activity. Result:
    latest: Pulling from srfoster/my-repo
    6714a7dc486b: Pulling fs layer
    5866500c2af9: Pulling fs layer
    ... ETC ...
  </code></pre>
  
  <p>Based on one of the (not accepted) answers to this similar question...</p>
  
  <p><a href="https://stackoverflow.com/questions/25963729/why-are-docker-build-commands-running-so-slow-in-elastic-beanstalk">Why are Docker build commands running so slow in Elastic Beanstalk?</a></p>
  
  <p>I ran </p>
  
  <pre><code>docker info | grep Storage
  </code></pre>
  
  <p>and got back</p>
  
  <pre><code>devicemapper
  </code></pre>
  
  <p>Supposedly, aufs is faster than devicemapper (according to the question linked above). </p>
  
  <p>Buuuut, even if that's true, I wouldn't know how to make Beanstalk's prebuilt images use one versus the other when spinning up.</p>
  
  <p>Any suggestions on this?  Or is there some other way to go about fixing the slow deployments?</p>