NPM install via git+https//x-oauth-basic within Docker container fails
I have a node project that I have stood up on my host server (Ubuntu 14.04), I can pull my repo and perform the NPM install without issue on the host. My package.json includes some private repos where we use the with https to have npm pull in our private dependencies.
like so in our “dependencies” in our package.json:
I’m trying to run this same application from within a docker container, but on build of our docker image the npm install fails on our private repo calls. It throws an error:
Failed to connect to github.com port 443: Connection timed out
The normal dependencies in NPM all work fine from within the container. What is causing the error to our private repos?
One Solution collect form web for “NPM install via git+https//x-oauth-basic within Docker container fails”
As suspected, outbound access to GitHub was being blocked by the server:
“Yup you guessed it, I added my ENV http_proxy to my Dockerfile and it worked. I had configured NPM in the container to use the proxy but I didn’t realize I needed to set it for the container as well.”