[英]Docker Compose: cannot run ssh: No such file or directory
I'm trying to use docker-compose to fetch, build and run multiple services from their git repositories. 我正在尝试使用docker-compose从其git存储库中获取,构建和运行多个服务。 I made a simple docker-compose.yml to test it:
我做了一个简单的docker-compose.yml来测试它:
version: '3'
services:
test-service:
build: git@gitlab.com:dan-poltherm/partservicego.git
ports:
- 8005:443
It seems that docker-compose can't fetch repository I get following error when calling docker-compose up --build
: 似乎docker-compose无法获取存储库,在调用
docker-compose up --build
时出现以下错误:
ERROR: error fetching: fatal: cannot run ssh: No such file or directory
I have OpenSSH Client installed (Windows 10 port) and %SYSTEMROOT%\\System32\\OpenSSH\\
added to PATH, I also set GIT_SSH
to C:\\Windows\\System32\\OpenSSH\\ssh.exe
. 我已经安装了OpenSSH Client(Windows 10端口),并且
%SYSTEMROOT%\\System32\\OpenSSH\\
添加到PATH,我还将GIT_SSH
设置为C:\\Windows\\System32\\OpenSSH\\ssh.exe
。 I can clone repo with git clone
and ssh
also works from powershell. 我可以使用
git clone
克隆回购协议,并且ssh
也可以从powershell中使用。
个人访问令牌是一种方法
As far as i know, "build:" is the path where your Dockerfile is located. 据我所知, “ build:”是您的Dockerfile所在的路径。
I would suggest to checkout the repository, and put the docker-compose.yml inside the folder. 我建议检出存储库,并将docker-compose.yml放入文件夹中。
Then change your docker-compose.yml to: 然后将您的docker-compose.yml更改为:
version: '3'
services:
test-service:
build: .
ports:
- 8005:443
From the docs ( https://docs.docker.com/compose/compose-file/ ): 从文档( https://docs.docker.com/compose/compose-file/ ):
build can be specified either as a string containing a path to the build context:
可以将build指定为包含构建上下文路径的字符串:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.