Add SSH key to Docker container

1149695 pts.
Tags:
Container
Docker
SSH
My friend and I have an application that executes a bunch of things with Git and we're trying to put it in a Docker container. But here's the issue: We can't figure out how to add a SSH key to the container itself. We tried using Git (Git SSH wrapper) but no luck. What should I do?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • AjitK29

    Turns out when using Ubuntu, the ssh_config isn't correct. You need to add

    RUN  echo "    IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
    

    to your Dockerfile in order to get it to recognize your ssh key.

    2,545 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: