I am trying to run following docker build command on Jenkins slave ( Ubuntu 20.04.2 LTS
) using Jenkinsfile
eval "ssh-agent -s"
docker build -t example-build:$BUILD_NUMBER --ssh default .
But its failing with following error
+ eval ssh-agent -s
+ ssh-agent -s
SSH_AUTH_SOCK=/tmp/ssh-x8AGvtzhvjQ7/agent.1347; export SSH_AUTH_SOCK;
SSH_AGENT_PID=1348; export SSH_AGENT_PID;
echo Agent pid 1348;
+ docker build -t example-build:78 --ssh default .
ERROR: invalid empty ssh agent socket: make sure SSH_AUTH_SOCK is set
I am on Docker version 26.1.4, build 5650f9b
Above build command works fine on Macbook