-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_manylinux
41 lines (37 loc) · 1.77 KB
/
Dockerfile_manylinux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Docker image generator for manylinux. See:
# https://github.com/pypa/manylinux/tree/manylinux1
# Build with: (note the -t cslug-manylinux1_x86_64 is just an arbitrary name)
# $ docker build -t cslug-manylinux1_x86_64 -f Dockerfile_manylinux .
# Or to specify an alternative base (say manylinux1_i686 for 32bit Linux):
# $ docker build -t cslug-manylinux1_i686 -f Dockerfile_manylinux --build-arg BASE=manylinux1_i686 .
# Then boot into your new image with:
# $ docker run -it cslug-manylinux1_x86_64
# The above launches bash inside the image. You can append arbitrary shell
# commands to run those instead such as the following to launch Python:
# $ docker run -it cslug-manylinux1_x86_64 python
# Or to run pytest:
# $ docker run -it cslug-manylinux1_x86_64 pytest
# This repo is copied into the image on `docker build` into the path /io which
# is also the default cwd. To instead mount this repo so that file changes are
# synchronised use:
# $ docker run -v `pwd`:/io -it cslug-manylinux1_x86_64
ARG BASE=manylinux1_x86_64
FROM quay.io/pypa/${BASE}
# Choosing a Python version is done just by prepending its bin dir to PATH.
ENV PATH=/opt/python/cp39-cp39/bin:$PATH
ENV FORCE_COLOR=1
RUN pip install wheel
# Install dependencies. Installing as many as possible before the ``COPY . /io``
# helps docker to cache them.
# Otherwise this block could be replaced with just ``COPY . /io``.
COPY pyproject.toml /io/pyproject.toml
COPY README.rst /io/README.rst
COPY tests/requirements.txt /io/tests/requirements.txt
# Set the repo's root as the cwd.
WORKDIR /io
# Install more dependencies.
RUN pip install --prefer-binary -e . -r tests/requirements.txt
# Work around new metapath nonsense
RUN ln -s /io/cslug /opt/python/cp39-cp39/lib/python3.9/site-packages/cslug
# Copy across this repo.
COPY . /io