forked from GafferHQ/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
132 lines (123 loc) · 4.03 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# We start with CentOS 7, because it is commonly used in
# production, and meets the glibc requirements of VFXPlatform 2018
# (2.17 or lower).
FROM centos:7.6.1810
# As we don't want to inadvertently grab newer versions of our yum-installed
# packages, we use yum-versionlock to keep them pinned. We track the list of
# image packages here, then compare after our install steps to see what was
# added, and only lock those. This saves us storing redundant entires for
# packages installed in the base image.
# To unlock versions, just make sure yum-versionlock.list is empty in the repo
COPY versionlock.sh ./
COPY yum-versionlock.list /etc/yum/pluginconf.d/versionlock.list
RUN yum install -y yum-versionlock && \
./versionlock.sh list-installed /tmp/packages && \
#
#
# NOTE: If you add a new yum package here, make sure you update the version
# lock files as follows and commit the changes to yum-versionlock.list:
#
# ./build-docker.py --update-package-versions --new-only
#
# We have to install scl as a separate yum command for some reason
# otherwise we get `scl not found` errors...
#
yum install -y centos-release-scl && \
sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo && \
yum install -y devtoolset-6 && \
#
# Install CMake, SCons, and other miscellaneous build tools.
# We install SCons via `pip install --egg` rather than by
# `yum install` because this prevents a Cortex build failure
# caused by SCons picking up the wrong Python version and being
# unable to find its own modules.
#
yum install -y epel-release && \
#
yum install -y cmake3 && \
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
#
yum install -y python2-pip.noarch && \
pip install --upgrade pip && \
pip install scons==3.0.5 && \
#
yum install -y \
git \
patch \
doxygen && \
#
# Install boost dependencies (needed by boost::iostreams)
#
yum install -y bzip2-devel && \
#
# Install JPEG dependencies
#
yum install -y nasm && \
#
# Install PNG dependencies && \
#
yum install -y zlib-devel && \
#
# Install GLEW dependencies
#
yum install -y \
libX11-devel \
mesa-libGL-devel \
mesa-libGLU-devel \
libXmu-devel \
libXi-devel && \
#
# Install OSL dependencies
#
yum install -y \
flex \
bison && \
#
# Install Qt dependencies
#
yum install -y \
xkeyboard-config.noarch \
fontconfig-devel.x86_64 \
libxkbcommon-x11-devel.x86_64 && \
#
# Install Appleseed dependencies
#
yum install -y \
lz4 lz4-devel
#
# Install packages needed to generate the
# Gaffer documentation.
RUN yum install -y \
xorg-x11-server-Xvfb \
mesa-dri-drivers.x86_64 \
metacity \
gnome-themes-standard && \
# Note: When updating these, also update gaffer/config/azure/build.yaml
pip install \
sphinx==1.8.1 \
sphinx_rtd_theme==0.4.3 \
recommonmark==0.5.0 \
docutils==0.12 && \
#
yum install -y inkscape && \
#
# Now we've installed all our packages, update yum-versionlock for all the
# new packages so we can copy the versionlock.list out of the container when we
# want to update the build env.
# If there were already locks in the list from the source checkout then the
# correct version will already be installed and we just ignore this...
./versionlock.sh lock-new /tmp/packages
# Make GCC 6.3.1 the default compiler, as per VFXPlatform 2018
#
# We can't use ENTRYPOINT as it's not allowed on Azure. The ENV/BASH_ENV vars
# are sourced whenever a non-interactive sh/bash session is started.
# PROMPT_COMMAND is evaluated before a prompt is displayed in interactive
# sessions. Using all of these ensures that our scl_enable script
# is always run, regardless of which shell is being used. The scl_enable script
# simply unsets these (as its work will be done) and sources the appropriate
# scl environment. Thanks to:
# https://austindewey.com/2019/03/26/enabling-software-collections-binaries-on-a-docker-image/
RUN printf "unset BASH_ENV PROMPT_COMMAND ENV\nsource scl_source enable devtoolset-6\n" > /usr/bin/scl_enable
ENV BASH_ENV="/usr/bin/scl_enable" \
ENV="/usr/bin/scl_enable" \
PROMPT_COMMAND=". /usr/bin/scl_enable"