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:

  • Deploy a docker app using volume create
  • Browserify cannot find module 'react-router-dom'
  • docker stack deploy do not remove services that are not declared in the current yaml compose file
  • MySQL bind-address in a Docker container
  • Why can't I extend docker postgres image to create extra database and user
  • cannot connect: com.github.dockerjava.api.NotFoundException

  • "local_utils": "git+http://12345:x-oauth-basic@github.com/ourprivateteam/local_utils.git",

    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?

  • Docker random ports & AWS Elastic Load Balancer
  • Keycloak and Docker - Cannot set two types of URLs
  • Connection refused when accessing web app through Docker
  • Get Docker Container Names
  • Why is the Docker vfs storage backend not considered suitable for production?
  • Docker port mapping: 3-way handshake although nothing is listening
  • 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.”

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.