为什么Docker构建命令在Elastic Beanstalk中运行如此缓慢? [英] Why are Docker build commands running so slow in Elastic Beanstalk?
问题描述
docker build
来看看发生了什么。每一步,即使是像 mkdir
一样简单的一切都需要很长时间才能运行。即使一个 WORKDIR
在执行前至少停了一两分钟。 在我的本地机器上,这些都是即时的。发生什么事情?
与在AWS上运行的Ubuntu机器相同的问题。结果解决方案的关键是从devicemapper切换到aufs存储后端。
首先,运行以下命令找出您当前使用的存储后端: p>
docker info | grep存储
如果它说 devicemapper
,你可能会发现缓慢的原因。
以下是在Ubuntu中切换到aufs后端的功能,取自此处:
-
sudo apt-get install -y -q linux-image-extra - $( uname -r)
-
sudo service docker restart
请注意,您将必须重新构建所有现有的图像/容器,因为在切换到aufs时将被擦除。
EB was complaining that my build was timing out, so I ssh'd into an instance and decided to run docker build
myself to see what was happening. Every step, even something as simple as a mkdir
takes ages to run. Even a WORKDIR
stalls for at least a minute or two before executing.
On my local machine these are instant. What is going on?
Same issue here with an Ubuntu machine running on AWS. Turns out the the key to the solution was switching from devicemapper to aufs storage backend.
First, run the following command to figure out which storage backend your currently use:
docker info | grep Storage
If it says devicemapper
, you probably found the reason for the slowness.
Here is the prodecure for switching to the aufs backend in Ubuntu, taken from here:
sudo apt-get install -y -q linux-image-extra-$(uname -r)
sudo service docker restart
Note that you will have to rebuild all your existing images / containers, as they will be wiped when you switch to aufs.
这篇关于为什么Docker构建命令在Elastic Beanstalk中运行如此缓慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!