title: Django, Docker, Python - Unable to install Pillow on python-alpine
body: <p>I have a dockerized django app that I want to put in production. But ever since I added an Imagefield Pillow is required and I struggle to install Pillow in the Docker container.</p>
  
  <p>As far as I understand it, adding the dependencies jpeg-dev ibjpeg &amp; zlib-dev should be enough for django (?). With the configuration below I receive the error:</p>
  
  <p><strong>Error on <code>runserver</code>:</strong></p>
  
  <pre><code>product.Product.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
      HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
  product.Product.thumbnail: (fields.E210) Cannot use ImageField because Pillow is not installed.
      HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
  </code></pre>
  
  <p><strong>If I add Pillow to requirements.txt (or putting <code>pip install Pillow</code> in the Dockerfile) I get an even longer error message while trying to build the container.</strong></p>
  
  <p>Without putting <code>pip install Pillow</code> in Dockerfile or requirements.txt - this is my configuration.</p>
  
  <p><strong>Dockerfile:</strong></p>
  
  <pre><code># pull official base image
  FROM python:3.7-alpine
  
  # set environment varibles
  ENV PYTHONDONTWRITEBYTECODE 1
  ENV PYTHONUNBUFFERED 1
  
  # set work directory
  WORKDIR /usr/src/kitschoen-dj
  
  RUN pip install --upgrade pip
  
  # install psycopg2
  RUN apk update \
      &amp;&amp; apk add --virtual build-deps gcc python3-dev musl-dev \
      &amp;&amp; apk add postgresql \
      &amp;&amp; apk add postgresql-dev \
      &amp;&amp; pip install psycopg2 \
      &amp;&amp; apk del build-deps
      &amp;&amp; apk add jpeg-dev \
      &amp;&amp; apk add libjpeg \
      &amp;&amp; apk add zlib-dev
  
  # install dependencies
  RUN pip install --upgrade pip
  COPY ./requirements.txt /usr/src/kitschoen-dj/requirements.txt
  RUN pip install -r requirements.txt
  
  # copy entrypoint.sh
  COPY ./entrypoint.sh /usr/src/kitschoen-dj/entrypoint.sh
  
  # copy project
  COPY . /usr/src/kitschoen-dj/
  
  # run entrypoint.sh
  ENTRYPOINT ["/usr/src/kitschoen-dj/entrypoint.sh"]
  </code></pre>
  
  <p><strong>Requirements.txt</strong></p>
  
  <pre><code>astroid==2.1.0
  certifi==2018.11.29
  chardet==3.0.4
  Django==2.1.7
  django-cors-headers==2.4.0
  django-filter==2.1.0
  djangorestframework==3.9.1
  djangorestframework-simplejwt==3.3
  gunicorn==19.9.0
  httpie==1.0.2
  httpie-jwt-auth==0.3.0
  idna==2.8
  isort==4.3.4
  lazy-object-proxy==1.3.1
  Markdown==3.0.1
  mccabe==0.6.1
  PyJWT==1.7.1
  requests==2.21.0
  six==1.12.0
  urllib3==1.24.1
  wrapt==1.11.1
  </code></pre>
  
  <p>I have been stuck with this for a while. Can someone help?</p>