“The headers or library files could not be found for jpeg” installing Pillow on Alpine Linux

后端 未结 10 1559
闹比i
闹比i 2021-02-01 12:33

I\'m trying to run Python\'s Scrapy in a Docker container based on python:alpine. It was working before, but now I\'d like to use Scrapy\'s Image Pipeline which requires me to i

10条回答
  •  无人共我
    2021-02-01 13:02

    Have you try to create a requirements.txt and insert this in Dockerfile:

        RUN apt-get update -qq && apt-get install build-essential g++ flex bison gperf ruby perl \
      mysql-client \
      libsqlite3-dev libmysqlclient-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \
      libpng-dev libjpeg-dev python libx11-dev libxext-dev -y
     ENV PYTHONUNBUFFERED 1
     RUN mkdir /code
     WORKDIR /code
     ADD requirements.txt /code/
     COPY . /code
     RUN pip install -r requirements.txt
     ADD . /code/
    

    example of requirements.txt

    Django==1.9.7
    django-appconf==1.0.1
    django-filer==1.2.5
    django-filter==0.15.0
    django-grappelli==2.8.1
    django-image-cropping==1.0.3
    django-mptt==0.8.6
    django-nested-admin==3.0.10
    django-nested-inline==0.3.6
    django-polymorphic==0.8.1
    django-taggit==0.21.2
    django-tinymce==2.4.0
    dnspython==1.15.0
    easy-thumbnails==2.3
    enum34==1.1.2
    funcsigs==0.4
    idna==2.1
    ipaddress==1.0.17
    mercurial==3.7.3
    mock==1.3.0
    mysql-python
    ndg-httpsclient==0.4.2
    parsedatetime==2.1
    pbr==1.8.0
    Pillow==3.3.1
    psutil==3.4.2
    pyasn1==0.1.9
    PyICU==1.9.2
    pyOpenSSL==16.1.0
    pyRFC3339==1.0
    python-augeas==0.5.0
    python-monkey-business==1.0.0
    python2-pythondialog==3.3.0
    pytz==2014.10
    requests==2.11.1
    six==1.10.0
    Unidecode==0.4.19
    urllib3==1.16
    zope.component==4.2.2
    zope.event==4.2.0
    zope.hookable==4.0.4
    zope.interface==4.1.3
    

提交回复
热议问题