On my desktop machine I've developed a docker container which clones some Git repository. To provide the credentials I mount my local ssh-agent as it is specified in $SSH_AUTH_SOCK
into the docker container.
Now I want to deploy this docker image on a headless docker host which is running ubuntu. I've created a key-pair for the server which I've also granted access to the Git repository. But when I login the $SSH_AUTH_SOCK
variable is not set and no ssh-agent is running. Just forwarding it via ssh -A
is definitely not what I want.
How do I start the ssh-agent properly to make it accessible to the docker container?