-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
82 lines (73 loc) · 2.62 KB
/
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
77
78
79
80
81
82
# Build a portable nantille/blender_28_mod in a virtual env.
#
# Useful link at https://wiki.blender.org/wiki/Building_Blender/Linux/Fedora
FROM centos:7.4.1708
LABEL mantainer="Francesco Maria Cultrera"
LABEL mantainer-mail="scriptfx@outlook.it"
# Blender 2.8 requires Python 3.7
ENV PY3VER=3.7.7
# Blender branch from which to build
# if you want latest alpha set it to "master"
ENV BRANCH=master
# Update sys and install needed packages
RUN yum -y update \
&& yum install -y epel-release centos-release-scl \
&& yum clean all \
&& yum install -y \
gcc \
gcc-c++ \
git \
subversion \
wget \
make \
cmake \
cmake3 \
openssl-devel \
bzip2-devel \
libffi-devel \
libX11-devel \
libXi-devel \
libXcursor-devel \
libXrandr-devel \
libXinerama-devel \
libXxf86vm-devel \
libstdc++-static \
devtoolset-7-gcc-c++ \
rpm-build \
mesa-libGLU-devel \
&& yum clean all
# Use cmake3 instead of version 2
RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Build Python 3.7 and install pip (useful if you
# won't have an option to install it later)
RUN mkdir /usr/src/python37 \
&& cd /usr/src/python37 \
&& wget https://www.python.org/ftp/python/$PY3VER/Python-$PY3VER.tgz \
&& tar xzf Python-$PY3VER.tgz \
&& cd Python-$PY3VER \
&& ./configure --enable-optimizations \
&& make altinstall \
&& curl https://bootstrap.pypa.io/get-pip.py | python3.7 \
&& pip3 install --upgrade pip
# Get blender mod and precompiled library dependencies
RUN mkdir /usr/src/blender \
&& cd /usr/src/blender \
&& git clone git://github.com/nantille/blender_28_mod \
&& mkdir /usr/src/blender/lib \
&& cd /usr/src/blender/lib \
&& svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64 \
&& cd /usr/src/blender/blender_28_mod \
&& git remote set-url origin git://git.blender.org/blender.git \
&& git submodule sync \
&& git submodule update --init --recursive \
&& git submodule foreach git checkout $BRANCH \
&& git submodule foreach git pull --rebase origin $BRANCH \
&& git remote set-url origin https://github.com/nantille/blender_28_mod.git
# Build and package it
COPY compile.sh /usr/src/
RUN chmod +x /usr/src/compile.sh \
&& scl enable devtoolset-7 /usr/src/compile.sh