Adding your git ssh keys to docker container (for linux)

I wanted to have an option to use ssh keys I use for git not only on host machine but also on remote one made by docker. To do that I tried several ways how to push this key to container. There are some info on SSH forwarding but in the end what worked best for me is just simple mounting a file (ssh key) to php container (using docker4drupal by wodby). So what I did was is add another volume under my main volume that is added in PHP service.

      - ./:/var/www/html
      - /home/marko/.ssh/id_rsa:/home/wodby/.ssh/id_rsa

So it looks like this. I mounted id_rsa file to user which is used to. login to php container and where I run drush commands. This way key is available there as default and I can make bash scripts that use drush and git and run them in container (like pulling repos, updating DBs etc)