Using ssh-agent with docker on macOS

后端 未结 8 2127
不思量自难忘°
不思量自难忘° 2021-02-02 10:18

I would like to use ssh-agent to forward my keys into the docker image and pull from a private github repo.

I am using a slightly modified version of https://github.com/

8条回答
  •  梦毁少年i
    2021-02-02 10:30

    A one-liner:

    Here’s how to set it up on Ubuntu 16 running a Debian Jessie image:

    docker run --rm -it --name container_name \
    -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) \
    -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK my_image
    

    https://techtip.tech.blog/2016/12/04/using-ssh-agent-forwarding-with-a-docker-container/

提交回复
热议问题