My docker image should be able to access private git repository on github via ssh. For that I am trying to make host's ssh client accessible to the builder. The image should not store secrets and should work on any host whatever that host may be.
On my windows machine I do the following (inside the folder containing my Dockerfile):
SET SSH_AUTH_SOCK=\\.\\pipe\\openssh-ssh-agent
SET DOCKER_BUILDKIT=1
docker build --ssh default .
And I get:
could not parse ssh: [default]: failed to open \\.\\pipe\\openssh-ssh-agent: open \\.\\pipe\\openssh-ssh-agent: All pipe instances are busy.
The outcome doesn't depend on the contents of the Dockerfile: same happens with any Dockerfile, such as this:
FROM alpine:latest
Versions info:
OpenSSH (by running ssh -V):
OpenSSH_for_Windows_8.6p1, LibreSSL 3.0.2
(originally it was 8.1; the error was already present)
docker (by running docker version):
Client:
Cloud integration: v1.0.20
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:47:53 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:30 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Other info:
\\.\\pipe\\openssh-ssh-agent is present within the output of
[System.IO.Directory]::GetFiles("\\.\\pipe\\") (ran in powershell)
ssh-agent StartupType is set to Automatic and GET-SERVICE ssh-agent (ran in powershell) says the service is Running