Why are Docker build commands so slow in Elastic Beanstalk?

EB complained that my build was disabled, so I ssh'd into the instance and decided to run docker build myself to see what was happening. Every step, even something as simple as mkdir , takes time to start. Even a WORKDIR stops for at least a minute or two before executing.

On my local machine, this is instant. What's happening?

+6
source share
2 answers

The same problem occurs with an Ubuntu machine running on AWS. Turns off the key to the solution, switches from devicemapper to the aufs backend.

First, run the following command to find out which back-up for storage is currently in use:

docker info | grep Storage

If he says devicemapper , you probably found the reason for the slowness.

Here, for example, is 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

Please note that you will have to rebuild all existing images / containers as they will be deleted when you switch to aufs.

+8
source

Sorry to encounter this issue. Flexible creation of a Beanstalk environment involves the creation of many resources, such as an autoscale group, EC2 instances, security groups, Elastic Load Balancer, etc. After that, the software is installed on your beanstalk instances. I assume that you are only talking about the slow installation of software (assembling dockers) on beanstalk.

If you just run mkdir, this should not be very slow. It should be fast enough.

However, if you think docker assembly is very slow, this may be due to intensive I / O.

You can try to use EOPs that provide IOPs with an elastic beanstalk . Read more about SSD instances here .

Can you try starting a new environment using SSD instances and see if the docker assembly is still slow? If you can show an example docker file that takes a long time to build, I can try it.

0
source

Source: https://habr.com/ru/post/975614/


All Articles