【发布时间】:2017-09-04 14:11:36
【问题描述】:
我正在尝试使用pip(根据亚马逊的建议)在FROM library/node:6.11.2 提供的自定义Docker 映像中安装awscli。这是一个再现:
FROM library/node:6.11.2
RUN apt-get update && \
apt-get install -y \
python \
python-pip \
python-setuptools \
groff \
less \
&& pip --no-cache-dir install --upgrade awscli \
&& apt-get clean
CMD ["/bin/bash"]
但是,我遇到了上述情况:
no such option: --no-cache-dir
大概是因为我的 Python 和/或 Pip 版本不正确?
我正在以与FROM maven:3.5.0-jdk-8 类似的方式安装 Python、Pip 和 awscli,它工作得很好。我不确定两张图片之间的相关差异是什么。
从我的 Dockerfile 中删除上述选项对我也没有多大好处,因为我遇到了一大堆不同的错误,摘录在这里:
Installing collected packages: awscli, PyYAML, docutils, rsa, colorama, botocore, s3transfer, pyasn1, jmespath, python-dateutil, futures, six
Running setup.py install for PyYAML
checking if libyaml is compilable
### ABBREVIATED ###
ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
### ABBREVIATED ###
底线:如何在基于library/node:6.x 的图像中正确安装awscli?
【问题讨论】:
标签: python amazon-web-services docker pip