问题
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