1*387f9dfdSAndroid Build Coastguard WorkerARG VERSION="18.04" 2*387f9dfdSAndroid Build Coastguard WorkerFROM ubuntu:${VERSION} 3*387f9dfdSAndroid Build Coastguard Worker 4*387f9dfdSAndroid Build Coastguard WorkerARG LLVM_VERSION="11" 5*387f9dfdSAndroid Build Coastguard WorkerENV LLVM_VERSION=$LLVM_VERSION 6*387f9dfdSAndroid Build Coastguard Worker 7*387f9dfdSAndroid Build Coastguard WorkerARG SHORTNAME="bionic" 8*387f9dfdSAndroid Build Coastguard Worker 9*387f9dfdSAndroid Build Coastguard WorkerARG RUBY_INSTALL_VERSION="0.8.4" 10*387f9dfdSAndroid Build Coastguard WorkerENV RUBY_INSTALL_VERSION=$RUBY_INSTALL_VERSION 11*387f9dfdSAndroid Build Coastguard Worker 12*387f9dfdSAndroid Build Coastguard WorkerARG RUBY_VERSION="3.1.2" 13*387f9dfdSAndroid Build Coastguard WorkerENV RUBY_VERSION=$RUBY_VERSION 14*387f9dfdSAndroid Build Coastguard Worker 15*387f9dfdSAndroid Build Coastguard WorkerRUN apt-get update && apt-get install -y curl gnupg &&\ 16*387f9dfdSAndroid Build Coastguard Worker llvmRepository="\n\ 17*387f9dfdSAndroid Build Coastguard Workerdeb http://apt.llvm.org/${SHORTNAME}/ llvm-toolchain-${SHORTNAME} main\n\ 18*387f9dfdSAndroid Build Coastguard Workerdeb-src http://apt.llvm.org/${SHORTNAME}/ llvm-toolchain-${SHORTNAME} main\n\ 19*387f9dfdSAndroid Build Coastguard Workerdeb http://apt.llvm.org/${SHORTNAME}/ llvm-toolchain-${SHORTNAME}-${LLVM_VERSION} main\n\ 20*387f9dfdSAndroid Build Coastguard Workerdeb-src http://apt.llvm.org/${SHORTNAME}/ llvm-toolchain-${SHORTNAME}-${LLVM_VERSION} main\n" &&\ 21*387f9dfdSAndroid Build Coastguard Worker echo $llvmRepository >> /etc/apt/sources.list && \ 22*387f9dfdSAndroid Build Coastguard Worker curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - 23*387f9dfdSAndroid Build Coastguard Worker 24*387f9dfdSAndroid Build Coastguard WorkerARG DEBIAN_FRONTEND="noninteractive" 25*387f9dfdSAndroid Build Coastguard WorkerENV TZ="Etc/UTC" 26*387f9dfdSAndroid Build Coastguard Worker 27*387f9dfdSAndroid Build Coastguard WorkerRUN apt-get update && apt-get install -y \ 28*387f9dfdSAndroid Build Coastguard Worker util-linux \ 29*387f9dfdSAndroid Build Coastguard Worker bison \ 30*387f9dfdSAndroid Build Coastguard Worker binutils-dev \ 31*387f9dfdSAndroid Build Coastguard Worker cmake \ 32*387f9dfdSAndroid Build Coastguard Worker flex \ 33*387f9dfdSAndroid Build Coastguard Worker g++ \ 34*387f9dfdSAndroid Build Coastguard Worker git \ 35*387f9dfdSAndroid Build Coastguard Worker kmod \ 36*387f9dfdSAndroid Build Coastguard Worker wget \ 37*387f9dfdSAndroid Build Coastguard Worker libelf-dev \ 38*387f9dfdSAndroid Build Coastguard Worker zlib1g-dev \ 39*387f9dfdSAndroid Build Coastguard Worker libiberty-dev \ 40*387f9dfdSAndroid Build Coastguard Worker liblzma-dev \ 41*387f9dfdSAndroid Build Coastguard Worker libbfd-dev \ 42*387f9dfdSAndroid Build Coastguard Worker libedit-dev \ 43*387f9dfdSAndroid Build Coastguard Worker clang-${LLVM_VERSION} \ 44*387f9dfdSAndroid Build Coastguard Worker libclang-${LLVM_VERSION}-dev \ 45*387f9dfdSAndroid Build Coastguard Worker libclang-common-${LLVM_VERSION}-dev \ 46*387f9dfdSAndroid Build Coastguard Worker libclang1-${LLVM_VERSION} \ 47*387f9dfdSAndroid Build Coastguard Worker llvm-${LLVM_VERSION} \ 48*387f9dfdSAndroid Build Coastguard Worker llvm-${LLVM_VERSION}-dev \ 49*387f9dfdSAndroid Build Coastguard Worker llvm-${LLVM_VERSION}-runtime \ 50*387f9dfdSAndroid Build Coastguard Worker libllvm${LLVM_VERSION} \ 51*387f9dfdSAndroid Build Coastguard Worker systemtap-sdt-dev \ 52*387f9dfdSAndroid Build Coastguard Worker sudo \ 53*387f9dfdSAndroid Build Coastguard Worker iproute2 \ 54*387f9dfdSAndroid Build Coastguard Worker python3 \ 55*387f9dfdSAndroid Build Coastguard Worker python3-pip \ 56*387f9dfdSAndroid Build Coastguard Worker ethtool \ 57*387f9dfdSAndroid Build Coastguard Worker arping \ 58*387f9dfdSAndroid Build Coastguard Worker netperf \ 59*387f9dfdSAndroid Build Coastguard Worker iperf \ 60*387f9dfdSAndroid Build Coastguard Worker iputils-ping \ 61*387f9dfdSAndroid Build Coastguard Worker bridge-utils \ 62*387f9dfdSAndroid Build Coastguard Worker libtinfo5 \ 63*387f9dfdSAndroid Build Coastguard Worker libtinfo-dev \ 64*387f9dfdSAndroid Build Coastguard Worker xz-utils \ 65*387f9dfdSAndroid Build Coastguard Worker zip && \ 66*387f9dfdSAndroid Build Coastguard Worker apt-get -y clean 67*387f9dfdSAndroid Build Coastguard Worker 68*387f9dfdSAndroid Build Coastguard WorkerRUN pip3 install pyroute2==0.5.18 netaddr==0.8.0 dnslib==0.9.14 cachetools==3.1.1 69*387f9dfdSAndroid Build Coastguard Worker 70*387f9dfdSAndroid Build Coastguard Worker# FIXME this is faster than building from source, but it seems there is a bug 71*387f9dfdSAndroid Build Coastguard Worker# in probing libruby.so rather than ruby binary 72*387f9dfdSAndroid Build Coastguard Worker#RUN apt-get update -qq && \ 73*387f9dfdSAndroid Build Coastguard Worker# apt-get install -y software-properties-common && \ 74*387f9dfdSAndroid Build Coastguard Worker# apt-add-repository ppa:brightbox/ruby-ng && \ 75*387f9dfdSAndroid Build Coastguard Worker# apt-get update -qq && apt-get install -y ruby2.6 ruby2.6-dev 76*387f9dfdSAndroid Build Coastguard Worker 77*387f9dfdSAndroid Build Coastguard WorkerRUN wget -O ruby-install-${RUBY_INSTALL_VERSION}.tar.gz \ 78*387f9dfdSAndroid Build Coastguard Worker https://github.com/postmodern/ruby-install/archive/v${RUBY_INSTALL_VERSION}.tar.gz && \ 79*387f9dfdSAndroid Build Coastguard Worker tar -xzvf ruby-install-${RUBY_INSTALL_VERSION}.tar.gz && \ 80*387f9dfdSAndroid Build Coastguard Worker cd ruby-install-${RUBY_INSTALL_VERSION}/ && \ 81*387f9dfdSAndroid Build Coastguard Worker make install && \ 82*387f9dfdSAndroid Build Coastguard Worker cd .. && \ 83*387f9dfdSAndroid Build Coastguard Worker rm -rf ruby-install-${RUBY_INSTALL_VERSION}* 84*387f9dfdSAndroid Build Coastguard Worker 85*387f9dfdSAndroid Build Coastguard WorkerRUN ruby-install --system ruby ${RUBY_VERSION} -c -- --enable-dtrace 86*387f9dfdSAndroid Build Coastguard WorkerRUN if [ ! -f "/usr/bin/python" ]; then ln -s /bin/python3 /usr/bin/python; fi 87*387f9dfdSAndroid Build Coastguard WorkerRUN if [ ! -f "/usr/local/bin/python" ]; then ln -s /usr/bin/python3 /usr/local/bin/python; fi 88