Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 1 | # Copyright 2020 the original author or 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 ubuntu:16.04 |
| 16 | |
| 17 | # Update to have latest images |
| 18 | RUN apt-get update && apt-get -q -y install \ |
Girish Gowdra | 46aec6c | 2020-04-26 17:27:37 -0700 | [diff] [blame] | 19 | git=1:2.7.4-0ubuntu1.9 \ |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 20 | pkg-config=0.29.1-0ubuntu1 \ |
| 21 | build-essential=12.1ubuntu2 \ |
| 22 | autoconf=2.69-9 libtool=2.4.6-0.1 \ |
| 23 | libgflags-dev=2.1.2-3 \ |
| 24 | clang=1:3.8-33ubuntu3.1 \ |
| 25 | libc++-dev=3.7.0-1ubuntu0.1 \ |
| 26 | unzip=6.0-20ubuntu1 \ |
Girish Gowdra | 3714c5c | 2021-01-28 11:33:37 -0800 | [diff] [blame] | 27 | libssl-dev=1.0.2g-1ubuntu4.18 \ |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 28 | gawk=1:4.1.3+dfsg-0.1 \ |
| 29 | debhelper=9.20160115ubuntu3 \ |
| 30 | dh-systemd=1.29ubuntu4 \ |
| 31 | init-system-helpers=1.29ubuntu4 \ |
Girish Gowdra | 3714c5c | 2021-01-28 11:33:37 -0800 | [diff] [blame] | 32 | curl=7.47.0-1ubuntu2.18 \ |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 33 | ccache=3.2.4-1 \ |
| 34 | g++-4.9=4.9.3-13ubuntu2 \ |
| 35 | wget=1.17.1-1ubuntu1.5 \ |
Girish Gowdra | 0b14f6e | 2020-11-03 23:13:46 -0800 | [diff] [blame] | 36 | ca-certificates=20201027ubuntu0.16.04.1 \ |
Girish Gowdra | fddb175 | 2020-09-04 17:59:22 -0700 | [diff] [blame] | 37 | lcov=1.12-2 \ |
Girish Gowdra | 0b14f6e | 2020-11-03 23:13:46 -0800 | [diff] [blame] | 38 | libgoogle-glog-dev=0.3.4-0.1 \ |
| 39 | libpcap-dev=1.7.4-2ubuntu0.1 && \ |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 40 | apt-get clean && \ |
| 41 | rm -rf /var/lib/apt/lists/* |
| 42 | |
Girish Gowdra | 3714c5c | 2021-01-28 11:33:37 -0800 | [diff] [blame] | 43 | # Set g++-4.9 and gcc-4.9 as the default versions |
| 44 | RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 &&\ |
| 45 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 |
| 46 | |
Girish Gowdra | fddb175 | 2020-09-04 17:59:22 -0700 | [diff] [blame] | 47 | # Install cmake (need cmake version 3.15.0 or later to compile grpc c++ 1.31.1) |
| 48 | RUN wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.sh && \ |
| 49 | sh cmake-linux.sh -- --skip-license && rm cmake-linux.sh |
| 50 | |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 51 | ARG GRPC_VER |
| 52 | # Download, compile and install gRPC. Remove the source and build artificats after install. |
Girish Gowdra | fddb175 | 2020-09-04 17:59:22 -0700 | [diff] [blame] | 53 | RUN cd /tmp && git clone --recurse-submodules -b $GRPC_VER https://github.com/grpc/grpc && \ |
| 54 | cd /tmp/grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF ../.. && \ |
| 55 | make && make install && cd /tmp && \ |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 56 | rm -rf /tmp/grpc |
| 57 | |
Girish Gowdra | 0b14f6e | 2020-11-03 23:13:46 -0800 | [diff] [blame] | 58 | ARG PCAPPLUSPLUS_VER |
| 59 | # Download, compile and install PcapPlusPlus. Remove the source and build artificats after install. |
| 60 | RUN cd /tmp && git clone -b $PCAPPLUSPLUS_VER https://github.com/seladb/PcapPlusPlus.git && \ |
| 61 | cd /tmp/PcapPlusPlus && ./configure-linux.sh —default && \ |
| 62 | make all && make install && cd /tmp && \ |
| 63 | rm -rf /tmp/PcapPlusPlus |
| 64 | |
Girish Gowdra | ab4cd69 | 2020-02-13 17:36:54 +0530 | [diff] [blame] | 65 | ARG GTEST_VER |
| 66 | # Download compile and install gtest library. Remove the source and build artificats after install. |
| 67 | RUN cd /tmp && git clone https://github.com/google/googletest.git && \ |
| 68 | cd /tmp/googletest && git checkout $GTEST_VER && \ |
| 69 | cd /tmp/googletest && cmake CMakeLists.txt && \ |
| 70 | make && make install && ldconfig && \ |
| 71 | rm -rf /tmp/googletest |
| 72 | |
| 73 | ARG CMOCK_VER |
| 74 | # Download and install C-Mock library. Remove the source and build artificats after install. |
| 75 | RUN cd /tmp && git clone https://github.com/hjagodzinski/C-Mock.git && \ |
| 76 | cd /tmp/C-Mock && git checkout $CMOCK_VER && \ |
| 77 | make install && \ |
| 78 | rm -rf /tmp/C-Mock |
| 79 | |
| 80 | ARG GMOCK_GLOBAL_VER |
| 81 | # Download and install gmock-global library. Remove the source and build artificats after install. |
| 82 | RUN cd /tmp && git clone https://github.com/apriorit/gmock-global.git && \ |
| 83 | cd /tmp/gmock-global && git checkout $GMOCK_GLOBAL_VER && \ |
| 84 | cp -rf /tmp/gmock-global/include/gmock-global /usr/local/include && rm -rf /tmp/gmock-global |
| 85 | |
| 86 | WORKDIR /app |