I'd like to have a section like this in my docker-compose.yml
file:
services:
thing:
build: git@server.company.com/path/to/project.git
Then I'd like to build it with docker-compose build thing
But when I try that it fails with
ERROR: error fetching: fatal: 'git@server.company.com/path/to/project.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Presumably it's failing because it needs my ssh keys to access the repository and the docker daemon is running in a linux VM which doesn't have access to my keys.
How can I pass a ssh key, or an ssh agent socket to the docker daemon so it can access a private repository?