Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何在Mac OS X上将ssh凭据传递给docker守护进程?_Macos_Docker_Ssh - Fatal编程技术网

Macos 如何在Mac OS X上将ssh凭据传递给docker守护进程?

Macos 如何在Mac OS X上将ssh凭据传递给docker守护进程?,macos,docker,ssh,Macos,Docker,Ssh,我希望在我的docker compose.yml文件中有这样一个部分: services: thing: build: git@server.company.com/path/to/project.git 然后我想用docker compose build thing 但当我尝试这样做时,它失败了 ERROR: error fetching: fatal: 'git@server.company.com/path/to/project.git' does not

我希望在我的
docker compose.yml
文件中有这样一个部分:

 services:
     thing:
          build: git@server.company.com/path/to/project.git
然后我想用docker compose build thing

但当我尝试这样做时,它失败了

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.
可能它失败了,因为它需要我的ssh密钥来访问存储库,而docker守护进程运行在一个无法访问我的密钥的linux VM中


如何将ssh密钥或ssh代理套接字传递给docker守护进程,使其能够访问私有存储库?

这回答了您的问题。我认为不会。这是关于首先传递ssh信条来访问docker文件,而不是访问容器中的ssh密钥