K. Kowalczyk
K. Kowalczyk

Reputation: 987

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. I made a simple docker-compose.yml to test it:

version: '3'

services:
  test-service:
    build: [email protected]: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.

Upvotes: 5

Views: 5877

Answers (2)

Pari
Pari

Reputation: 518

Personal access token is a way to go

Upvotes: 5

homelessDevOps
homelessDevOps

Reputation: 20726

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:

Upvotes: -1

Related Questions