Installing GCC 5.3.0 In CentOS 6 In Docker.

Home » CentOS » Installing GCC 5.3.0 In CentOS 6 In Docker.
CentOS No Comments

I need to compile some C++ 11 with GCC 5.3.0 on CentOS 6. All of this is happening inside docker in CI using the CentOS:6 base image. (NB. It can’t be GCC 6 or 7, because I have to send binaries to clients who won’t install newer vs of libstdc++.so.)

Until recently, I was installing devtoolset-4-gcc-c++ via yum, and then using

RUN scl enable devtoolset-4 gcc

to build the code. Unfortunately, devtoolset-4 is no longer supported, so this has stopped working.

I’ve been trying to compile GCC from scratch, but it’s been running for hours and hours – even if I get it working, I’ll have to replicate the whole process inside Docker and I suspect it will be very brittle.

Is there any easy way of downloading a precompiled version? E.g.
— Is there something that I can do to go back to the old v. of Software Collections? Or
— Is there somewhere I might find a precompiled gcc 5 package?

Thanks very much, Mohan