安装Python 3 Docker Ubuntu错误命令'x86_64-linux-gnu-gcc

我正在尝试创build一个使用Python 3的dockerfile。

FROM ubuntu:14.04 RUN apt-get update RUN apt-get install -y python3 python3-dev python-pip RUN apt-get install -y libxml2-dev libxslt1-dev libpq-dev libjpeg-dev libfreetype6-dev zlib1g-dev RUN cd /var/projects/apps && pip install -r requirements.txt 

我得到的错误致命错误:Python.h:没有这样的文件或目录时,试图安装枕头在我的要求,为什么,我是我正确安装python 3?

 error: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-C7CMih-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pillow Storing debug log for failure in /root/.pip/pip.log INFO[0102] The command [/bin/sh -c cd /var/projects/app && pip install -r requirements.txt] returned a non-zero code: 1 

你应该在你的Dockerfile中安装python3-pip ,然后运行pip3 install -r requirements.txt