Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. FROM centos:7
  15. RUN yum install -y python3
  16. RUN yum install -y python3-devel
  17. RUN yum install -y epel-release
  18. RUN yum install -y python3-pip
  19. RUN python3 -m pip install --upgrade pip==19.3.1
  20. RUN python3 -m pip install -U virtualenv
  21. # The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 5.1,
  22. # the minimum supported gcc version for gRPC Core so let's upgrade to
  23. # the oldest one that can build gRPC on Centos 7.
  24. RUN yum install -y centos-release-scl
  25. RUN yum install -y devtoolset-8-binutils devtoolset-8-gcc devtoolset-8-gcc-c++
  26. # Activate devtoolset-8 by default
  27. # https://austindewey.com/2019/03/26/enabling-software-collections-binaries-on-a-docker-image/
  28. RUN echo $'#!/bin/bash\n\
  29. source scl_source enable devtoolset-8\n\
  30. "$@"\n' > /usr/bin/entrypoint.sh
  31. RUN chmod +x /usr/bin/entrypoint.sh
  32. RUN cat /usr/bin/entrypoint.sh
  33. ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
  34. CMD ["/bin/bash"]