我的docker构建失败,出现以下错误:
Untar fork/exec /usr/bin/docker: cannot allocate memory
所以我得到它 – 没有RAM :)但我可以清楚地看到空闲内存作为交换:
total used free shared buffers cached
Mem: 7517 7334 183 0 59 515
-/+ buffers/cache: 6759 758
Swap: 4095 2635 1460
此外,似乎docker占用了一个巨大的内存块:
$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
所以问题是:
为什么不“docker build”使用交换区域作为额外的RAM并决定杀死构建?
最佳答案
原文链接:https://www.f2er.com/docker/435989.html