I am getting this error while trying to install aws cli from pip.
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 File:
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
Issue This is my Docker file and I’m getting error by this. can someone help me with this. Any suggestions will be highly appreciated.
2
Answers
I seems you don’t have
python3
norpython3-pip
in your image. You can rectify the issue by installing it.Instead of:
you can write:
Instead of installing Python3, I recommend using Python2.7 and updating the URL.(This is for learning purpose not for production environment)
You can refer updated URL using below-attached artifact,