#dockerBuild() with Dockerfile and RUN --mount=type=ssh

1 messages · Page 1 of 1 (latest)

pale wagon
#

Hello,

I'm trying to build an image (for troubleshooting purpose, as I didn't manage to forward the ssh agent) using .dockerBuild() and a Dockerfile containing something like

RUN --mount=type=ssh,uid=1000 ssh-add -L

which errors with error fetching identities: communication with agent failed. The uid=1000 is because I'm using the node image and the user is node(1000)

I managed to make it work with container().withUnixSocket(...).withEnvVariable(...).withExec([...]) separately.

I've noticed the SSH_AUTH_SOCK env var outputs /run/buildkit/ssh_agent.0 when echo-ing it in the Dockerfile whereas from the working version, it'd be the same as my host.

Is there anything I'm missing?

Thanks

frosty isle
pale wagon