We are migrating to Docker and we are trying to build our app inside a docker image. The app is a Node app and is built with webpack.
Until now we were building the app inside the Circle Ci image and it took about 130 seconds to build it. When changing to docker and building the image with the remote docker machine we saw an increase from 130 seconds to 405 seconds. This is a 3 time increase in the build time!
On the local development machine we saw no difference between building the app on the host or with docker.
The docker build machine is running at 200% when building the app inside docker (tested with
docker stats and by ssh into the docker machine and running
top command), so the processor seems to be fully used. The memory doesn’t seem to be a issue (only 4Gb/ 8Gb are used), the network is not used at all and the disk is only used at the end of the build to save the compiled app.
I’m not sure that this is the problem, but I saw that Circle Ci is using different machines when running tests and when building images for deployment. The test machines seem to be running
Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz and the building/ docker machines are running
Intel(R) Xeon(R) CPU @ 2.30GHz. Full specs from lscpu here.
Can anything be done to speed-up those machines or the build process?