From c3adcc730844de1fb4354c78e69aa6b004c5a929 Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Mon, 9 Dec 2019 15:37:39 +0100
Subject: [PATCH] CentOS 7: Enable GCC 8 by default

---
 centos-7/Dockerfile | 10 ++--------
 centos-7/gcc-8.sh   |  1 +
 2 files changed, 3 insertions(+), 8 deletions(-)
 create mode 100644 centos-7/gcc-8.sh

diff --git a/centos-7/Dockerfile b/centos-7/Dockerfile
index 56456ed..46146c8 100644
--- a/centos-7/Dockerfile
+++ b/centos-7/Dockerfile
@@ -22,9 +22,10 @@ RUN yum install -y centos-release-scl && \
         && \
     ln -s /usr/bin/ninja-build /usr/local/bin/ninja && \
     yum clean all
+ADD gcc-8.sh /etc/profile.d/gcc-8.sh
+ENV BASH_ENV "/etc/profile"
 
 RUN version=3.15.5 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSLO https://cmake.org/files/v${version%.*}/cmake-${version}.tar.gz && \
     tar -xf cmake-${version}.tar.gz && \
@@ -56,7 +57,6 @@ RUN yum install -y \
         freetype-devel
 
 RUN version=4.2.1 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSLO http://ffmpeg.org/releases/ffmpeg-${version}.tar.gz && \
     tar -xf ffmpeg-${version}.tar.gz && \
@@ -67,7 +67,6 @@ RUN version=4.2.1 && \
     rm -rf ffmpeg-${version}*
 
 RUN version=1.10.5 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSLO https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${version%.*}/hdf5-${version}/src/hdf5-${version}.tar.bz2 && \
     tar -xf hdf5-${version}.tar.bz2 && \
@@ -120,7 +119,6 @@ RUN version=5.12.6 && \
     ln -s /opt/linuxdeployqt-${version}/AppRun /usr/local/bin/linuxdeployqt
 
 RUN version=3.4.8 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSL -o opencv-${version}.zip https://github.com/opencv/opencv/archive/${version}.zip && \
     unzip opencv-${version}.zip && \
@@ -165,7 +163,6 @@ RUN version=3.4.8 && \
 
 ENV MXNet_DIR /opt/mxnet-3.5.1
 RUN version=1.5.1 && \
-    source scl_source enable devtoolset-8 && \
     cd /opt && \
     curl -sSLO https://github.com/apache/incubator-mxnet/releases/download/${version}/apache-mxnet-src-${version}-incubating.tar.gz && \
     tar -xf apache-mxnet-src-${version}-incubating.tar.gz && \
@@ -189,7 +186,6 @@ RUN version=1.5.1 && \
     ninja -C build
 
 RUN version=2.3.0 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSL -o pybind11-${version}.tar.gz https://github.com/pybind/pybind11/archive/v${version}.tar.gz && \
     tar -xf pybind11-${version}.tar.gz && \
@@ -203,7 +199,6 @@ RUN version=2.3.0 && \
     rm -rf pybind11-${version}*
 
 RUN version=2.2.1 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSL -o rpclib-${version}.tar.gz https://github.com/rpclib/rpclib/archive/v2.2.1.tar.gz && \
     tar -xf rpclib-${version}.tar.gz && \
@@ -222,7 +217,6 @@ RUN yum install -y \
     yum clean all
 
 RUN version=3.7.5 && \
-    source scl_source enable devtoolset-8 && \
     cd /tmp && \
     curl -sSLO https://www.python.org/ftp/python/${version}/Python-${version}.tgz && \
     tar -xf Python-${version}.tgz && \
diff --git a/centos-7/gcc-8.sh b/centos-7/gcc-8.sh
new file mode 100644
index 0000000..cde5a41
--- /dev/null
+++ b/centos-7/gcc-8.sh
@@ -0,0 +1 @@
+source scl_source enable devtoolset-8
-- 
GitLab