Skip to content

Instantly share code, notes, and snippets.

@e2thenegpii
Last active August 12, 2021 04:07
Show Gist options
  • Save e2thenegpii/f1a453480cc286bcd62eeb08adbfa582 to your computer and use it in GitHub Desktop.
Save e2thenegpii/f1a453480cc286bcd62eeb08adbfa582 to your computer and use it in GitHub Desktop.
Build pythonnet for cp37-cp37m-linux_x86_64.whl
FROM mono:6.12.0 AS build
ENV PYTHONNET_VER=2.5.2
# Install all the things necessary to build pythonnet
RUN apt update && apt install python3.7 python3-pip python3.7-dev clang g++ gcc -y
# Setup the python environment
RUN python3 -m pip install -U pip setuptools wheel pycparser
# Build the pythonnet wheel
RUN python3 -m pip wheel pythonnet==$PYTHONNET_VER
FROM mono:6.12.0
RUN apt update && apt install python3.7 python3-pip python3.7-dev -y
COPY --from=build pythonnet-*.whl .
RUN python3 -m pip install -U pip pythonnet --find-links .
ENV PYTHONPATH=/usr/lib/mono/msbuild/Current/bin
ENTRYPOINT ["python3"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment