Alan Souza Alan Souza - 10 months ago 62
Node.js Question

Docker image create very slow under proxy network

I'm using Docker 1.12.3 and I'm trying to create an image on top of Node + Yarn. When I run

yarn install
it takes around 5 seconds to install when there is a
file present. I'm inside a corporate network with proxy configured. At home is even faster than 5 seconds.

On the other hand, when I run this command:

docker build -t alansouzati/testing . --build-arg HTTPS_PROXY=http://PROXY:PORT

The yarn install hangs in there forever. If I enter an existing image and try
yarn install
inside the container it works perfectly.

So this leads me to believe this is nothing wrong with my proxy configuration but with the Docker build creation process. I have tried to use
in the build command but it did not help.

Any recommendation on how to improve the Docker image creation when inside a proxied network?

Answer Source

After some investigation I realised that my base image was the problem, I was using:


Switching to


did the trick.

I guess Alpine node is to small and is removing something that is important for the proxy/network configuration