wodby / php

Generic PHP docker container images
MIT License
152 stars 103 forks source link

Multiple private keys? #73

Closed kevinquillen closed 5 years ago

kevinquillen commented 5 years ago

I need to add 2 private keys to the php container to get a private repo from github and talk to a different server with another command.

You can add a private SSH key to the container by mounting it to /home/wodby/.ssh/id_rsa

This does not allow for more than one key, how is this doable? I want to run composer inside the container (local dev purposes). How can I get the ssh-agent to recognize more than one identity file? Is there some command I can add to docker-compose to make it do that?

I am mounting 3 keys, and they are all in the container, problem is the ssh agent in the container only looks at id_rsa.

csandanov commented 5 years ago

There's nothing special in managing keys in docker image compared to just Linux, there's an openssh client installed in the image and you can run the ssh-agent, add your keys and mount ~/.ssh/config.