| 1 |
# Copyright 2015 gRPC authors. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
FROM centos:7 |
| 16 |
|
| 17 |
RUN yum install -y python3 |
| 18 |
RUN yum install -y python3-devel |
| 19 |
RUN yum install -y epel-release |
| 20 |
RUN yum install -y python3-pip |
| 21 |
RUN python3 -m pip install --upgrade pip==19.3.1 |
| 22 |
RUN python3 -m pip install -U virtualenv |
| 23 |
|
| 24 |
# The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 5.1, |
| 25 |
# the minimum supported gcc version for gRPC Core so let's upgrade to |
| 26 |
# the oldest one that can build gRPC on Centos 7. |
| 27 |
RUN yum install -y centos-release-scl |
| 28 |
RUN yum install -y devtoolset-8-binutils devtoolset-8-gcc devtoolset-8-gcc-c++ |
| 29 |
|
| 30 |
# Activate devtoolset-8 by default |
| 31 |
# https://austindewey.com/2019/03/26/enabling-software-collections-binaries-on-a-docker-image/ |
| 32 |
RUN echo $'#!/bin/bash\n\ |
| 33 |
source scl_source enable devtoolset-8\n\ |
| 34 |
"$@"\n' > /usr/bin/entrypoint.sh |
| 35 |
RUN chmod +x /usr/bin/entrypoint.sh |
| 36 |
RUN cat /usr/bin/entrypoint.sh |
| 37 |
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ] |
| 38 |
|
| 39 |
CMD ["/bin/bash"] |