小编Lau*_*IER的帖子

docker 中的 ssh-add - 无法打开与您的身份验证代理的连接

我正在尝试为我的 Python Flask API 创建一个 docker 镜像。

我需要 git 来安装依赖项,而且我已经在 docker 中安装了几次 git。但在这里,我无法理解我做错了什么。

与码头工人:

FROM python:3.6-slim

ARG ssh_prv_key
ARG ssh_pub_key

RUN apt-get update && \
    apt-get install -y openssh-server &&\
    apt-get install -y git

# Authorize SSH Host
RUN mkdir -p /root/.ssh && \
    chmod 0700 /root/.ssh && \
    ssh-keyscan github.com > /root/.ssh/known_hosts

# Add the keys and set permissions
RUN echo "$ssh_prv_key" > /root/.ssh/id_rsa && \
    echo "$ssh_pub_key" > /root/.ssh/id_rsa.pub && \
    chmod 600 /root/.ssh/id_rsa && \
    chmod 600 …
Run Code Online (Sandbox Code Playgroud)

git ssh ssh-agent docker

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

docker ×1

git ×1

ssh ×1

ssh-agent ×1