Connecting to the server where I build docker images
ssh -A user@myserver
Dockerfile
# syntax=docker/dockerfile:experimental
FROM golang
WORKDIR /go/src/github.com/xxx/xxx
RUN --mount=type=ssh git clone git@github.com:xxx/xxx.git .
...
Building image:
export DOCKER_BUILDKIT=1
docker build --ssh default=$SSH_AUTH_SOCK -t xxx/xxx .
...
#8 1.579 Host key verification failed.
#8 1.579 fatal: Could not read from remote repository.
#8 1.579
#8 1.579 Please make sure you have the correct access rights
#8 1.579 and the repository exists.
------
rpc error: code = Unknown desc = executor failed running [/bin/sh -c git clone git@github.com:xxx/xxx.git .]: exit code: 128
What I am missing?
UPDATE
export DOCKER_BUILDKIT=1
docker build --ssh default -t xxx/xxx .
Building locally produces same result.