我正在尝试为我的 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)