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).