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:

  • how to access OSX non-storage devices from docker container
  • Docker build php+nginx+pgsql in separated containers
  • Can't access postgresql in a docker container from a VM
  • Running a copy of docker container
  • Virtualize Kickstart Server
  • Amazon AWS ECS Task delay

  • "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?

  • Mount Docker volume on host but make files “immutable”?
  • Docker image is not visible through the Remote Docker API
  • cron task in docker container not being executed
  • Docker for windows container is not starting with -m 4g but works fine with -m 3g
  • Send request from one docker container to another
  • Docker publish ports during build
  • 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.