Dockerfile 3.5 KB

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