I’m just trying to create a docker image from this Dockerfile.
FROM debian:latest
USER root
ENV DEBIAN_FRONTEND noninteractive
ENV PATH /twecoll:$PATH
RUN apt-get update
RUN apt-get install -y build-essential libxml2-dev zlib1g-dev python-dev python-pip pkg-config libffi-dev libcairo-dev git
RUN pip install python-igraph
RUN pip install --upgrade cffi
RUN pip install cairocffi
RUN git clone https://github.com/jdevoo/twecoll.git
ADD .twecoll /root
WORKDIR /app
VOLUME /app
ENTRYPOINT ["twecoll"]
CMD ["-v"]
but when running RUN pip install python-igraph, an error appears like this.
Error Message:
Any idea why?
2
Answers
Try as the documentation suggests.
or
When you’re installing
python-igraph
frompip
and it can’t find a precompiled wheel for your distribution (which it mostly doesn’t),pip
will try to compile theigraph
binaries for your image, which 1) is error-prone, 2) takes a long time, 3) is the reason you need to install so many build tools and libraries. A better approach is to installigraph
from the Debian repositories withapt-get install python-igraph
first, which will install all the necessary requirements including a compiledigraph
.This leaves the following Dockerfile:
As you can see I’m just installing
python-igraph
, no more build tools! You may even be able to do something similar forcairo
andffi
but I’m leaving that for you.