-
Notifications
You must be signed in to change notification settings - Fork 140
/
manylinux.Dockerfile
76 lines (66 loc) · 2.34 KB
/
manylinux.Dockerfile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM tensorflow/tensorflow:custom-op-ubuntu16
#-----------------------------------------------------
# Download CMake
RUN curl -L -O https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2-Linux-x86_64.tar.gz && \
tar -xvzf cmake-3.15.2-Linux-x86_64.tar.gz && \
rm cmake-3.15.2-Linux-x86_64.tar.gz
ENV PATH /cmake-3.15.2-Linux-x86_64/bin:$PATH
#-----------------------------------------------------
# Install Miniconda and Python
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p /opt/conda \
&& rm ~/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
RUN conda install -y \
python=3.7 \
pytorch-cpu \
pybind11 \
tensorflow \
scikit-image \
&& conda clean -ya
#---------------------------------------------------
# Copy Redner app to container
COPY . /app
WORKDIR /app
RUN chmod -R a+w /app
#-----------------------------------------------------
# Build wheels and install
WORKDIR /app
RUN if [ -d "build" ]; then rm -rf build; fi \
&& python -m pip wheel -w /dist --verbose . \
&& python -m pip install /dist/redner*.whl
#-----------------------------------------------------
# Create a Python 3.6 environment
RUN conda create -n py36 python=3.6 \
&& conda run -n py36 conda install -y \
pytorch-cpu \
tensorflow \
pybind11 \
&& conda clean -ya
#-----------------------------------------------------
# Build wheels and convert
WORKDIR /app
RUN if [ -d "build" ]; then rm -rf build; fi \
&& conda run -n py36 python -m pip wheel -w /dist --verbose . \
&& for f in /dist/redner*-linux_*.whl; \
do \
auditwheel repair "$f" -w /dist; \
done
#-----------------------------------------------------
# Create a Python 3.8 environment
RUN conda create -n py38 python=3.8 \
&& conda run -n py38 conda install -y \
pytorch \
pybind11 -c pytorch \
&& conda run -n py38 pip install tensorflow \
&& conda clean -ya
#-----------------------------------------------------
# Build wheels and convert
WORKDIR /app
RUN if [ -d "build" ]; then rm -rf build; fi \
&& conda run -n py38 python -m pip wheel -w /dist --verbose . \
&& for f in /dist/redner*-linux_*.whl; \
do \
auditwheel repair "$f" -w /dist; \
done