【问题标题】:Installing aws cli using pip in Docker file在 Docker 文件中使用 pip 安装 aws cli
【发布时间】:2020-08-28 03:28:26
【问题描述】:

我在尝试从 pip 安装 aws cli 时遇到此错误。

ERROR: Service 'remote_host' failed to build: The command '/bin/sh -c curl -O https://bootstrap.pypa.io/get-pip.py &&     python3 get-pip.py &&     pip3 install awscli --upgrade' returned a non-zero code: 127

Docker 文件

FROM centos
RUN yum -y install openssh-server
RUN useradd remote_user && \
    echo remote_user:1234 | chpasswd && \
    mkdir /home/remote_user/.ssh && \
    chmod 700 /home/remote_user/.ssh
COPY remote-key.pub /home/remote_user/.ssh/authorized_keys
RUN chown remote_user:remote_user -R /home/remote_user/.ssh && \
    chmod 600 /home/remote_user/.ssh/authorized_keys
RUN /usr/bin/ssh-keygen -A
EXPOSE 22
RUN rm -rf /run/nologin

RUN yum -y install mysql
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
    python3 get-pip.py && \
    pip3 install awscli --upgrade
 
CMD /usr/sbin/sshd -D

问题这是我的 Docker 文件,我因此遇到了错误。有人可以帮我弄这个吗。任何建议都将受到高度赞赏。

【问题讨论】:

    标签: linux amazon-web-services docker jenkins aws-cli


    【解决方案1】:

    你的图片中似乎没有python3python3-pip。您可以通过安装它来解决问题。

    代替:

    RUN yum -y install mysql
    

    你可以写:

    RUN yum -y install mysql python3 python3-pip
    

    【讨论】:

      猜你喜欢
      • 2019-02-27
      • 1970-01-01
      • 2020-10-06
      • 2016-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-04
      相关资源
      最近更新 更多