What I Wanted to Do
Run npm install using a pre-written package.json file, inside a docker container, behind a cntlm corporate
proxy. Since cntlm hangs if there are too many requests being fired off (Error: too many files open), I set the maxsockets to 5 using npm set maxsockets 5.
What Happened Instead
The hundreds of requests were still fired, the maxsockets configuration was ignored, even though it appears
when I run
npm config list
This gist includes all dependencies of my project. it is a mirror of the package.json I am using.
Set up cntlm in gateway mode. Listen to the docker0 interface.
Traffic from within the container will be routed to the cntlm proxy handler (localhost:3128 by default)
Try to build the image. As soon as I reach the npm install command, it immediately fires off a lot of requests,
and within half a minute cntlm hangs. After a while (~15 minutes) this is what the shell outputs
I tried to do as much research as possible as I am trying to setup a CI/CD pipeline here.
It supposedly was an old issue : https://github.com/TooTallNate/node-agent-base/pull/18
That seems to have been fixed, but alas in my case, the maxsockets setting is still being ignored.
Hosting a mirror npm registry is out of the question currently. Getting rid of cntlm is also out of the question.
npm/6.4.1 node/v10.13.0 linux x64