wodby/python

Issues installing pillow.

Closed this issue · 5 comments

Hey,
not sure if this the correct place. I'm trying to use docker4python, but have issues with this image.

I'm trying to install Pillow, but I have the issue that libjpeg-dev is not available.
So I added the following to my docker4python Dockerfile
RUN sudo apk add jpeg-dev
but it still has the issues when I add Pillow to my requirements file.

It looks like the requirements.txt file is installed before my RUN command. I believe the issue that prevents me from reusing the wodby/python is in the wodby/python Dockerfile lines 170/171
ONBUILD COPY requirements.txt ./ ONBUILD RUN pip install --no-cache-dir -r requirements.txt

These ONBUILD commands are triggered before my RUN so I have no chance to install the requirements for Pillow.

Two solutions come to my mind:

  • Add jpeg-dev to this dockerfile (would help me with my initial problem of installing Pillow)
  • (Maybe) remove the ONBUILD commands as this seems to make reusing this Dockerfile almost impossible (but I'm not a docker expert and don't understand why they are here in the first place)

Thank you <3

jpeg-dev has been added to the dev version of the image

Thank you.

@csandanov
May I ask what was wrong with my pull request? Why did you not accept it?

You added the dependency to the runtime packages, not dev

I see. Thanks for clarifying that. I see the difference now.
That does mean that I can't use Pillow in a stable but only the dev container which you don't recommend, right?
I need Pillow to run Wagtail, which I obviously want to go live with at some point. I guess wodby/python and docker4python might not be the right choice for me then.

Or do you have any suggestions on getting Pillow to run on a stable system?

as I understand jpeg-dev is the requirement to build your pip package. In runtime there's no need for the dev package but perhaps you would need jpeg package that's currently missing. You can submit a PR for that.