Skip to content

Instantly share code, notes, and snippets.

@pfandzelter
Last active March 3, 2023 10:10
Show Gist options
  • Save pfandzelter/0d142eadf9248232ac65407a65a1562b to your computer and use it in GitHub Desktop.
Save pfandzelter/0d142eadf9248232ac65407a65a1562b to your computer and use it in GitHub Desktop.
slim Docker image with python3.8 and python3-igraph
# from https://github.com/igraph/python-igraph/blob/master/docker/minimal/Dockerfile
FROM python:3.8-alpine AS build
RUN apk add --no-cache --update \
make cmake gcc g++ libstdc++ git libxslt-dev libxml2-dev libc-dev \
libffi-dev zlib-dev libxml2 zlib libtool autoconf automake \
flex bison \
&& rm -rf /var/cache/apk/*
# this can take a while
# go and get a coffee
RUN pip3 install git+https://github.com/igraph/python-igraph
FROM python:3.8-slim
COPY --from=build /usr/local/lib/python3.8/site-packages/igraph /usr/local/lib/python3.8/site-packages/igraph
COPY --from=build /usr/local/bin/igraph /usr/local/bin/igraph
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
COPY your-script-file.py .
ENTRYPOINT [ "python3", "./your-script-file.py" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment