title: Docker npm install fails with local dependencies, but works in command line
body: <p>I'm trying to dockerize a project which uses some private npm dependencies that are on our GitLab server (url is something like 10.1.1.150). When I run npm install in CMD it works perfectly, but in Docker I get the following error:</p>
  
  <pre><code>npm ERR! Error while executing:
  npm ERR! /usr/bin/git ls-remote -h -t https://10.1.1.150/WebDev/firstdependency.git
  npm ERR!
  npm ERR! remote: HTTP Basic: Access denied
  npm ERR! fatal: Authentication failed for 'https://10.1.1.150/WebDev/firstdependency.git/'
  npm ERR!
  npm ERR! exited with error code: 128
  </code></pre>
  
  <p>My Dockerfile:</p>
  
  <pre><code>FROM node
  ENV NODE_ENV production
  WORKDIR /usr/src/app
  COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
  RUN npm set strict-ssl false --global
  RUN git init
  RUN git config --global http.sslVerify false
  RUN git config http.emptyAuth true
  RUN npm install --production
  RUN mv node_modules ../
  COPY . .
  CMD npm start
  </code></pre>
  
  <p>Part of the package.json file that contains the failed parts:</p>
  
  <pre><code>"repository": {
      "type": "git",
      "url": "https://10.1.1.150/WebDev/thisproject.git"
    },
    "dependencies": {
      "@mycompany/firstdependency": "git+https://10.1.1.150/WebDevelopment/firstdependency.git",
      "@mycompany/seconddependency": "git+https://10.1.1.150/WebDevelopment/seconddependency.git",
      "@mycompany/thirddependency": "git+https://10.1.1.150/WebDevelopment/thirddependency.git"
  </code></pre>
  
  <p>I guess the core of the problem is that I can't pass my credentials in the Dockerfile, so it can't log in to our local repo. 
  OS: WIN10
  npm: 6.13.4
  Docker: 19.03.2
  How can I resolve this authentication error?</p>