gpt4 book ai didi

docker - ssh-keygen : command not found in Docker

转载 作者:行者123 更新时间:2023-12-05 02:06:00 26 4
gpt4 key购买 nike

我正在尝试在 docker 容器中运行以下命令(centos 7 作为基础镜像)

ssh-keygen -t rsa -N ""

我得到这个错误:

ssh-keygen: command not found

这是我用来构建容器的Dockerfile

FROM centos:7

ENV VER "0.12.9"

RUN yum update -y && yum install wget -y && yum install unzip -y
RUN yum install epel-release -y && yum install ansible -y

RUN wget https://releases.hashicorp.com/terraform/${VER}/terraform_${VER}_linux_amd64.zip
RUN unzip terraform_${VER}_linux_amd64.zip
RUN mv terraform /usr/local/bin/
RUN rm -rf terraform_${VER}_linux_amd64.zip

有人可以帮帮我吗?

最佳答案

ssh-keygen是OpenSSH提供的命令,需要安装。

yum install openssh-clients -y 添加到您的 Dockerfile。

FROM centos:7

ENV VER "0.12.9"

RUN yum update -y && yum install wget -y && yum install unzip -y
RUN yum install epel-release -y && yum install ansible -y && yum install openssh-clients -y

RUN wget https://releases.hashicorp.com/terraform/${VER}/terraform_${VER}_linux_amd64.zip
RUN unzip terraform_${VER}_linux_amd64.zip
RUN mv terraform /usr/local/bin/
RUN rm -rf terraform_${VER}_linux_amd64.zip

关于docker - ssh-keygen : command not found in Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63042314/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com