Dockerfile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 silkeh/clang:13
  15. #=================
  16. # Basic C core dependencies
  17. # C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
  18. RUN apt-get update && apt-get install -y \
  19. build-essential \
  20. autoconf \
  21. libtool \
  22. pkg-config \
  23. && apt-get clean
  24. # GCC
  25. RUN apt-get update && apt-get install -y \
  26. gcc \
  27. gcc-multilib \
  28. g++ \
  29. g++-multilib \
  30. && apt-get clean
  31. # libc6
  32. RUN apt-get update && apt-get install -y \
  33. libc6 \
  34. libc6-dbg \
  35. libc6-dev \
  36. && apt-get clean
  37. # Tools
  38. RUN apt-get update && apt-get install -y \
  39. bzip2 \
  40. curl \
  41. dnsutils \
  42. git \
  43. lcov \
  44. make \
  45. strace \
  46. time \
  47. unzip \
  48. wget \
  49. zip \
  50. && apt-get clean
  51. #=================
  52. # C++ dependencies
  53. RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
  54. # Install Python 3.7 from source (and installed as a default python3)
  55. # (Bullseye comes with Python 3.9 which isn't supported by pytype yet)
  56. RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
  57. libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev
  58. RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \
  59. tar -xf Python-3.7.9.tar.xz && \
  60. cd Python-3.7.9 && \
  61. ./configure && \
  62. make -j 4 && \
  63. make install
  64. RUN curl https://bootstrap.pypa.io/get-pip.py | python3
  65. # Google Cloud Platform API libraries
  66. # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
  67. RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
  68. RUN mkdir /var/local/jenkins
  69. #========================
  70. # Sanity test dependencies
  71. RUN apt-get update && apt-get install -y \
  72. autoconf \
  73. automake \
  74. libtool \
  75. curl \
  76. shellcheck
  77. # otherwise clang-tidy will report missing <gtest/gtest.h> header
  78. RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean
  79. RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six
  80. # Upgrade Python's YAML library
  81. RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
  82. # Install prerequisites for the clang-tidy script
  83. RUN apt-get update && apt-get install -y jq git
  84. #========================
  85. # Bazel installation
  86. # Must be in sync with tools/bazel
  87. ENV BAZEL_VERSION 4.2.1
  88. # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
  89. ENV DISABLE_BAZEL_WRAPPER 1
  90. RUN apt-get update && apt-get install -y wget && apt-get clean
  91. RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
  92. bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
  93. rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
  94. # Install buildifier v0.29.0
  95. RUN wget https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier
  96. RUN chmod +x buildifier
  97. RUN mv buildifier /usr/local/bin
  98. # Define the default command.
  99. CMD ["bash"]