Skip to content

Instantly share code, notes, and snippets.

@5idu
Created July 30, 2018 06:55
Show Gist options
  • Save 5idu/8b370ffbdca444db41bda6c6aa415905 to your computer and use it in GitHub Desktop.
Save 5idu/8b370ffbdca444db41bda6c6aa415905 to your computer and use it in GitHub Desktop.
when npm install gitlab's repo, docker build failed.
### docker build failed when npm install from gitlab repo
#### 问题一:git 命令找不到
- 解决:`apk add git`,在镜像中安装git
#### 问题二:git pull repo 时提示无权限
- 解决:package.json中包链接修改成:`git+https://[username]:[password]@lab.qingteng.info/be/qingniu-lib.git`
#### 问题三:显式的将gitlab用户名密码暴露出来不安全
- 解决:使用repo tokent替代用户名密码pull repo,`settings -> Repository -> Deploy Tokens`,创建好token之后,使用token代替用户名密码pull repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment