Hello there, I’m trying to create a container for my node + vue application. The problem is that as a dependency I have a private repository hosted on gitlab.
The installation process on my local environment is very simple: I added this line in my package.json:
"lib-css": "git+ssh://git@git.company.com:9922/username/lib-css.git#development"
and then I simply run npm i
, and I insert my gitlab password when npm asks me for it.
That process fails during my docker build because there is no password insertion. I tried to add my private key as well like this:
WORKDIR /usr/src/app
RUN mkdir -p /root/.ssh
COPY .secrets /root/.ssh/id_rsa
# RUN ssh-keyscan -p 9922 git.geophy.com >> /root/.ssh/known_hosts
RUN chmod 700 /root/.ssh && chmod 600 /root/.ssh/*
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm install --only=production
# Bundle app source
COPY . .
EXPOSE 8081
CMD [ "npm", "run dev" ]
the file .secrets
contain my private key associatod to the public key in gitlab.
The build still fails with the error:
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
How can I solve this?