Inject host’s SSH keys into Docker Machine with Docker Compose

You can add this to your docker-compose.yml (assuming your user inside container is root):

volumes:
    - ~/.ssh:/root/.ssh

Also you can check for more advanced solution with ssh agent (I did not tried it myself)

Leave a Comment