从私有gilab存储库中提取的Docker容器
我正在为我的Node.js + Vue应用程序构build一个Docker容器。
由于我在另一个仓库中有一个全局的css库,我在我的package.json文件中添加了这一行:
"lib-css": "git+ssh://git@git.lib.com:9922/username/lib-css.git#development",
这样,当我运行npm install
我也安装我的CSS库。 问题是在我的本地env它要求我的密码,我可以插入它,但在Docker生成过程失败,出现以下错误:
Step 7/10 : RUN npm install ---> Running in db10ca83586d npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t ssh://git@git.lib.com:9922/username/lib-css.git npm ERR! 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 npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-12-11T08_49_11_152Z-debug.log
这是我目前的Dockerfile
:
FROM node:carbon WORKDIR /usr/src/app RUN mkdir -p /root/.ssh COPY .secrets /root/.ssh/id_rsa 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" ] ~
我的.secrets
文件包含与存储库关联的我的私钥。
我怎样才能做到这一点?
- 在Docker容器中调用OpenConnect VPN客户端显示TUNSETIFF失败:不允许操作
- 构builddocker for Python的最佳实践 – 需求文件或单独安装
- docker – 构build失败时,文件复制到根
- 与Iperf的haproxy udpstream量
- 如何使用sbt-docker和sbt-assembly创build一个All-in-One泊坞窗图像
- 在Dockerfile中重写FROM图像的ENV
- 为什么这个刷新标记请求auth.docker.io返回一个404?
- 如何防止在DCOS群集中删除未使用的docker集装箱图像?
- 如何从运行在docker上的jenkins创builddocker镜像