小编Kat*_*son的帖子

在具有私有存储库依赖项的 docker 容器内使用 Bower

我正在尝试在 docker 容器内运行bower install,作为命令传递docker-compose.yml

相关代码在docker-compose.yml

services:
  assets:
    build: ./src
    command: >
      sh -c '
      bower install --allow-root;
      '
Run Code Online (Sandbox Code Playgroud)

具有bower.json以下依赖性:

{
  "name": "projectname",
  "version": "version",
  "dependencies": {
    "remote-repo": "ssh://git@remoterepo.url/repo.git#branch"
  }
}
Run Code Online (Sandbox Code Playgroud)

这个远程仓库是私有的。主机具有可以从该远程提取的正确 SSH 凭据。

我尝试过 4 或 5 种不同的方式将 SSH 凭据从我的主机传递到 docker 容器,但每次尝试都会出现相同的错误消息:

docker_1   | bower repo#branch          ECMDERR Failed to execute "git 
ls-remote --tags --heads ssh://git@remoterepo.url/repo.git", exit code 
of #128 Host key verification failed. fatal: Could not read from 
remote repository.  Please make sure …
Run Code Online (Sandbox Code Playgroud)

git ssh bower docker

7
推荐指数
1
解决办法
1039
查看次数

标签 统计

bower ×1

docker ×1

git ×1

ssh ×1