Installing Python 3 Docker Ubuntu error command 'x86_64-linux-gnu-gcc

I’m trying to create a dockerfile that uses Python 3.

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

I get the error fatal error: Python.h: No such file or directory when trying to install pillow in my requirements, why and I’m I installing python 3 correctly?

  • DockerFile to run a java program
  • Simple docker containers: Build dedicated image or mount config as volume?
  • Spring Boot in Docker throwing an exception 'hibernate.dialect' not set
  • Can Ansible deploy Docker containers remotely?
  • Docker - How to analyze a container's disk usage?
  • docker is not VM , why container need base image OS ? [closed]
  • 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/';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

  • use inheritance in docker-compose.yml
  • gcloud ping attempt failure with performing a 'docker push'
  • Mesos, Docker and GRE Tunneling
  • docker base image with solaris operating system
  • Web application docker swarm where to put source code?
  • Unable to read file from mounted directory in docker
  • One Solution collect form web for “Installing Python 3 Docker Ubuntu error command 'x86_64-linux-gnu-gcc”

    You should install python3-pip in your Dockerfile and then run pip3 install -r requirements.txt

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.