forked from nytimes/rd-blender-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.2.93.6
86 lines (67 loc) · 2.74 KB
/
Dockerfile.2.93.6
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
77
78
79
80
81
82
83
84
85
86
# FROM nvidia/cudagl:10.1-base-ubuntu18.04
FROM nvidia/cuda:11.2.0-devel-ubuntu18.04
LABEL Author="Or Fleisher <[email protected]>"
LABEL Title="Blender in Docker"
# Enviorment variables
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH "$PATH:/bin/2.93/python/bin/"
ENV BLENDER_PATH "/bin/2.93"
ENV BLENDERPIP "/bin/2.93/python/bin/pip3"
ENV BLENDERPY "/bin/2.93/python/bin/python3.9"
ENV HW="GPU"
# Temp assignment
ENV BLENDER_PATH_2_92 "/bin/2.92"
ENV BLENDERPIP_2_92 "/bin/2.92/python/bin/pip3"
ENV BLENDERPY_2_92 "/bin/2.92/python/bin/python3.7m"
# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
libopenexr-dev \
bzip2 \
build-essential \
zlib1g-dev \
libxmu-dev \
libxi-dev \
libxxf86vm-dev \
libfontconfig1 \
libxrender1 \
libgl1-mesa-glx \
pciutils \
vim \
linux-headers-generic \
nvidia-driver-460 \
xz-utils
# Download and install Blender
RUN wget https://mirror.clarkson.edu/blender/release/Blender2.92/blender-2.92.0-linux64.tar.xz \
&& tar -xvf blender-2.92.0-linux64.tar.xz --strip-components=1 -C /bin \
&& rm -rf blender-2.92.0-linux64.tar.xz \
&& rm -rf blender-2.92.0-linux64
# Download the Python source since it is not bundled with Blender
RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \
&& tar -xzf Python-3.7.0.tgz \
&& cp -r Python-3.7.0/Include/* $BLENDER_PATH_2_92/python/include/python3.7m/ \
&& rm -rf Python-3.7.0.tgz \
&& rm -rf Python-3.7.0
# Must first ensurepip to install Blender pip3 and then new numpy
RUN ${BLENDERPY_2_92} -m ensurepip && ${BLENDERPIP_2_92} install --upgrade pip && ${BLENDERPIP_2_92} install mathutils
# Download and install Blender
RUN wget https://mirror.clarkson.edu/blender/release/Blender2.93/blender-2.93.6-linux-x64.tar.xz \
&& tar -xvf blender-2.93.6-linux-x64.tar.xz --strip-components=1 -C /bin \
&& rm -rf blender-2.93.6-linux-x64.tar.xz \
&& rm -rf blender-2.93.6-linux-x64
# Download the Python source since it is not bundled with Blender
RUN wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz \
&& tar -xzf Python-3.9.1.tgz \
&& cp -r Python-3.9.1/Include/* $BLENDER_PATH/python/include// \
&& rm -rf Python-3.9.1.tgz \
&& rm -rf Python-3.9.1
RUN mv ${BLENDER_PATH_2_92}/python/lib/python3.7/site-packages/math* ${BLENDER_PATH}/python/lib/python3.9/site-packages/
RUN rm -rf ${BLENDER_PATH_2_92}
# Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one
RUN rm -rf ${BLENDER_PATH}/python/lib/python3.9/site-packages/numpy
# Must first ensurepip to install Blender pip3 and then new numpy
RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy
# Set the working directory
WORKDIR /