• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15FROM centos:7
16
17RUN yum install -y python3
18RUN yum install -y python3-devel
19RUN yum install -y epel-release
20RUN yum install -y python3-pip
21RUN python3 -m pip install --upgrade pip==19.3.1
22RUN 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.
27RUN yum install -y centos-release-scl
28RUN 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/
32RUN echo $'#!/bin/bash\n\
33source scl_source enable devtoolset-8\n\
34"$@"\n' > /usr/bin/entrypoint.sh
35RUN chmod +x /usr/bin/entrypoint.sh
36RUN cat /usr/bin/entrypoint.sh
37ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
38
39CMD ["/bin/bash"]
40