title: docker build fails - "cannot allocate memory"
body: <p>My docker build fails with the following error:</p>
  
  <pre><code>Untar fork/exec /usr/bin/docker: cannot allocate memory
  </code></pre>
  
  <p>So I get it - no RAM :) but I can clearly see free memory as swap:</p>
  
  <pre><code>             total       used       free     shared    buffers     cached
  Mem:          7517       7334        183          0         59        515
  -/+ buffers/cache:       6759        758
  Swap:         4095       2635       1460
  </code></pre>
  
  <p>Also, it seems that docker takes a huge memory chunk:</p>
  
  <pre><code>$ top -a
  top - 03:48:07 up 18 days, 17 min,  2 users,  load average: 1.88, 0.93, 0.42
  Tasks: 127 total,   2 running, 125 sleeping,   0 stopped,   0 zombie
  Cpu(s): 49.9%us, 14.0%sy,  0.0%ni, 13.7%id, 22.2%wa,  0.0%hi,  0.2%si,  0.0%st
  Mem:   7697592k total,  6351288k used,  1346304k free,   138804k buffers
  Swap:  4194300k total,   310324k used,  3883976k free,  1449268k cached
  
    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   1340 root      20   0 3994m 2.1g 7548 S  6.6 28.8  64:20.43 docker
   5318 root      20   0 1499m 724m 4368 S 65.5  9.6   0:08.80 ruby
    978 root      20   0 1010m 616m   32 S  0.0  8.2   0:27.24 ruby
  </code></pre>
  
  <p>So the question is:<br>
  <strong>why doesn't "docker build" use the swap area as extra RAM and decides to kill the build?</strong></p>