Docker Compose: cannot run ssh: No such file or directory

喜夏-厌秋 提交于 2020-01-15 04:05:23

问题


I'm trying to use docker-compose to fetch, build and run multiple services from their git repositories. I made a simple docker-compose.yml to test it:

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:

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. I can clone repo with git clone and ssh also works from powershell.


回答1:


Personal access token is a way to go




回答2:


As far as i know, "build:" is the path where your Dockerfile is located.

I would suggest to checkout the repository, and put the docker-compose.yml inside the folder.

Then change your docker-compose.yml to:

version: '3'

services:
  test-service:
    build: .
    ports:
      - 8005:443

From the docs (https://docs.docker.com/compose/compose-file/):

build can be specified either as a string containing a path to the build context:



来源:https://stackoverflow.com/questions/52734337/docker-compose-cannot-run-ssh-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!