| # Copyright 2020 the original author or authors. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| FROM ubuntu:16.04 |
| |
| # Update to have latest images |
| RUN apt-get update && apt-get -q -y install \ |
| git=1:2.7.4-0ubuntu1.9 \ |
| pkg-config=0.29.1-0ubuntu1 \ |
| build-essential=12.1ubuntu2 \ |
| autoconf=2.69-9 libtool=2.4.6-0.1 \ |
| libgflags-dev=2.1.2-3 \ |
| clang=1:3.8-33ubuntu3.1 \ |
| libc++-dev=3.7.0-1ubuntu0.1 \ |
| unzip=6.0-20ubuntu1 \ |
| libssl-dev=1.0.2g-1ubuntu4.18 \ |
| gawk=1:4.1.3+dfsg-0.1 \ |
| debhelper=9.20160115ubuntu3 \ |
| dh-systemd=1.29ubuntu4 \ |
| init-system-helpers=1.29ubuntu4 \ |
| curl=7.47.0-1ubuntu2.18 \ |
| ccache=3.2.4-1 \ |
| g++-4.9=4.9.3-13ubuntu2 \ |
| wget=1.17.1-1ubuntu1.5 \ |
| ca-certificates=20201027ubuntu0.16.04.1 \ |
| lcov=1.12-2 \ |
| libgoogle-glog-dev=0.3.4-0.1 \ |
| libpcap-dev=1.7.4-2ubuntu0.1 && \ |
| apt-get clean && \ |
| rm -rf /var/lib/apt/lists/* |
| |
| # Set g++-4.9 and gcc-4.9 as the default versions |
| RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 &&\ |
| update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 |
| |
| # Install cmake (need cmake version 3.15.0 or later to compile grpc c++ 1.31.1) |
| 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 && \ |
| sh cmake-linux.sh -- --skip-license && rm cmake-linux.sh |
| |
| ARG GRPC_VER |
| # Download, compile and install gRPC. Remove the source and build artificats after install. |
| RUN cd /tmp && git clone --recurse-submodules -b $GRPC_VER https://github.com/grpc/grpc && \ |
| cd /tmp/grpc && mkdir -p cmake/build && cd cmake/build && cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF ../.. && \ |
| make && make install && cd /tmp && \ |
| rm -rf /tmp/grpc |
| |
| ARG PCAPPLUSPLUS_VER |
| # Download, compile and install PcapPlusPlus. Remove the source and build artificats after install. |
| RUN cd /tmp && git clone -b $PCAPPLUSPLUS_VER https://github.com/seladb/PcapPlusPlus.git && \ |
| cd /tmp/PcapPlusPlus && ./configure-linux.sh —default && \ |
| make all && make install && cd /tmp && \ |
| rm -rf /tmp/PcapPlusPlus |
| |
| ARG GTEST_VER |
| # Download compile and install gtest library. Remove the source and build artificats after install. |
| RUN cd /tmp && git clone https://github.com/google/googletest.git && \ |
| cd /tmp/googletest && git checkout $GTEST_VER && \ |
| cd /tmp/googletest && cmake CMakeLists.txt && \ |
| make && make install && ldconfig && \ |
| rm -rf /tmp/googletest |
| |
| ARG CMOCK_VER |
| # Download and install C-Mock library. Remove the source and build artificats after install. |
| RUN cd /tmp && git clone https://github.com/hjagodzinski/C-Mock.git && \ |
| cd /tmp/C-Mock && git checkout $CMOCK_VER && \ |
| make install && \ |
| rm -rf /tmp/C-Mock |
| |
| ARG GMOCK_GLOBAL_VER |
| # Download and install gmock-global library. Remove the source and build artificats after install. |
| RUN cd /tmp && git clone https://github.com/apriorit/gmock-global.git && \ |
| cd /tmp/gmock-global && git checkout $GMOCK_GLOBAL_VER && \ |
| cp -rf /tmp/gmock-global/include/gmock-global /usr/local/include && rm -rf /tmp/gmock-global |
| |
| WORKDIR /app |