相关疑难解决方法(0)

Docker 加载密钥“/root/.ssh/id_rsa”:格式无效

我正在尝试克隆一个包含子模块的存储库。主 repo 克隆正常,但是当我git submodule update --init --recursive在 dockerfile 中执行时,子模块抛出并出错。

fatal: clone of 'git@github.com:jkeys089/lua-resty-hmac.git' into submodule path '/tmp/third-party/lua-resty-hmac' failed
Failed to clone 'third-party/lua-resty-hmac'. Retry scheduled
Cloning into '/tmp/third-party/lua-resty-jwt'...
load pubkey "/root/.ssh/id_rsa": invalid format
Warning: Permanently added the RSA host key for IP address '140.82.118.3' to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

在图像中我有这个

# authorise ssh host
RUN mkdir /root/.ssh/ \
    && chmod 700 /root/.ssh \
    && ssh-keyscan github.com > /root/.ssh/known_hosts

# …
Run Code Online (Sandbox Code Playgroud)

git ssh github docker dockerfile

10
推荐指数
4
解决办法
2万
查看次数

标签 统计

docker ×1

dockerfile ×1

git ×1

github ×1

ssh ×1