Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
Github 如何为包含私有git repo的docker映像设置ssh密钥?_Github_Docker_Ssh Keys - Fatal编程技术网

Github 如何为包含私有git repo的docker映像设置ssh密钥?

Github 如何为包含私有git repo的docker映像设置ssh密钥?,github,docker,ssh-keys,Github,Docker,Ssh Keys,我正在尝试生成一个docker映像,该映像需要它克隆一个私有github repo。我很难弄清楚如何在不复制ssh密钥的情况下实现这一点-我最终的解决方案是使用URL格式的github基本身份验证令牌作为构建参数传递到docker 在Dockerfile中 ARG GITHUB\u URL 运行git config--全局url.$GITHUB\u url.insteof“” 运行go-get-u github.com/YOUR_USERNAME/YOUR_REPO 建筑时 docker bui

我正在尝试生成一个docker映像,该映像需要它克隆一个私有github repo。

我很难弄清楚如何在不复制ssh密钥的情况下实现这一点-我最终的解决方案是使用URL格式的github基本身份验证令牌作为构建参数传递到docker

在Dockerfile中 ARG GITHUB\u URL 运行git config--全局url.$GITHUB\u url.insteof“”

运行go-get-u github.com/YOUR_USERNAME/YOUR_REPO

建筑时 docker build-t你的标签--build arg GITHUB\u URL=“https://[您的\u GITHUB\u令牌]:x-oauth-basic@github.com/“

此处-可能重复的