From 0e627afeb093622437cd52fe39fc36dc6e10b603 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 13 Oct 2022 23:33:22 -0700 Subject: [PATCH] install: moved all dockerfiles to a specific directory and updated package files to account for recent changes and install ospf mdr and emane --- .../Dockerfile.centos | 0 dockerfiles/Dockerfile.centos-package | 58 +++++++++++++++++++ .../Dockerfile.oracle | 0 .../Dockerfile.ubuntu | 0 dockerfiles/Dockerfile.ubuntu-package | 39 +++++++++++++ package/Dockerfile.centos | 12 ---- package/Dockerfile.ubuntu | 15 ----- 7 files changed, 97 insertions(+), 27 deletions(-) rename Dockerfile.centos => dockerfiles/Dockerfile.centos (100%) create mode 100644 dockerfiles/Dockerfile.centos-package rename Dockerfile.oracle => dockerfiles/Dockerfile.oracle (100%) rename Dockerfile.ubuntu => dockerfiles/Dockerfile.ubuntu (100%) create mode 100644 dockerfiles/Dockerfile.ubuntu-package delete mode 100644 package/Dockerfile.centos delete mode 100644 package/Dockerfile.ubuntu diff --git a/Dockerfile.centos b/dockerfiles/Dockerfile.centos similarity index 100% rename from Dockerfile.centos rename to dockerfiles/Dockerfile.centos diff --git a/dockerfiles/Dockerfile.centos-package b/dockerfiles/Dockerfile.centos-package new file mode 100644 index 00000000..227720af --- /dev/null +++ b/dockerfiles/Dockerfile.centos-package @@ -0,0 +1,58 @@ +# syntax=docker/dockerfile:1 +FROM centos:7 +LABEL Description="CORE CentOS Image" + +# install basic dependencies +RUN yum update -y && yum install -y wget + +# install python3.9 +WORKDIR /opt +RUN wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz +RUN tar xf Python-3.9.15.tgz +RUN yum install -y make && yum-builddep -y python3 +RUN cd Python-3.9.15 && \ + ./configure --enable-optimizations --with-ensurepip=install && \ + make -j$(nproc) altinstall +RUN python3.9 -m pip install --upgrade pip + +# install core +WORKDIR /opt/core +COPY core_*.rpm . +RUN PYTHON=/usr/local/bin/python3.9 yum install -y ./core_*.rpm +ENV PATH "$PATH:/opt/core/venv/bin" + +# install ospf mdr +RUN yum install -y automake gawk git libreadline-devel libtool pkg-config +WORKDIR /opt +RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git +RUN cd ospf-mdr && \ + ./bootstrap.sh && \ + ./configure --disable-doc --enable-user=root --enable-group=root \ + --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \ + --localstatedir=/var/run/quagga && \ + make -j$(nproc) && \ + make install + +# install emane +RUN yum install -y libpcap-devel libpcre3-devel libxml2-devel protobuf-devel unzip uuid-devel +WORKDIR /opt +RUN wget -q https://adjacentlink.com/downloads/emane/emane-1.3.3-release-1.el7.x86_64.tar.gz && \ + tar xf emane-1.3.3-release-1.el7.x86_64.tar.gz && \ + cd emane-1.3.3-release-1/rpms/el7/x86_64 && \ + yum install -y epel-release && \ + yum install -y ./openstatistic*.rpm ./emane*.rpm ./python3-emane_*.rpm && \ + cd ../../../.. && \ + rm emane-1.3.3-release-1.el7.x86_64.tar.gz && \ + rm -rf emane-1.3.3-release-1 +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip && \ + mkdir protoc && \ + unzip protoc-3.7.1-linux-x86_64.zip -d protoc +RUN git clone https://github.com/adjacentlink/emane.git +RUN PATH=/opt/protoc/bin:$PATH && \ + cd emane && \ + git checkout v1.3.3 && \ + ./autogen.sh && \ + PYTHON=/opt/core/venv/bin/python ./configure --prefix=/usr && \ + cd src/python && \ + make && \ + /opt/core/venv/bin/python -m pip install . diff --git a/Dockerfile.oracle b/dockerfiles/Dockerfile.oracle similarity index 100% rename from Dockerfile.oracle rename to dockerfiles/Dockerfile.oracle diff --git a/Dockerfile.ubuntu b/dockerfiles/Dockerfile.ubuntu similarity index 100% rename from Dockerfile.ubuntu rename to dockerfiles/Dockerfile.ubuntu diff --git a/dockerfiles/Dockerfile.ubuntu-package b/dockerfiles/Dockerfile.ubuntu-package new file mode 100644 index 00000000..92933e91 --- /dev/null +++ b/dockerfiles/Dockerfile.ubuntu-package @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1 +FROM ubuntu:22.04 +LABEL Description="CORE Docker Ubuntu Image" + +# define environment +ENV DEBIAN_FRONTEND=noninteractive + +# install basic dependencies +RUN apt-get update && apt-get install -y python3 python3-tk python3-pip python3-venv +RUN python3 -m pip install --upgrade pip + +# install core +WORKDIR /opt/core +COPY core_*.deb . +RUN apt-get install -y ./core_*.deb +ENV PATH "$PATH:/opt/core/venv/bin" + +# install ospf mdr +RUN apt-get install -y automake gawk git libreadline-dev libtool pkg-config +WORKDIR /opt +RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git +RUN cd ospf-mdr && \ + ./bootstrap.sh && \ + ./configure --disable-doc --enable-user=root --enable-group=root \ + --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \ + --localstatedir=/var/run/quagga && \ + make -j$(nproc) && \ + make install + +# install emane +RUN apt-get install -y libpcap-dev libpcre3-dev libprotobuf-dev libxml2-dev protobuf-compiler uuid-dev +WORKDIR /opt +RUN git clone https://github.com/adjacentlink/emane.git +RUN cd emane && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j$(nproc) && \ + make install +RUN /opt/core/venv/bin/python -m pip install emane/src/python diff --git a/package/Dockerfile.centos b/package/Dockerfile.centos deleted file mode 100644 index babbc0c7..00000000 --- a/package/Dockerfile.centos +++ /dev/null @@ -1,12 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM centos:7 -LABEL Description="CORE CentOS Image" - -# install basic dependencies -RUN yum update -y && yum install -y python3 python3-pip python3-tkinter -RUN python3 -m pip install --upgrade pip - -# install core -WORKDIR /opt/core -COPY core_*.rpm . -RUN yum install -y ./core_*.rpm diff --git a/package/Dockerfile.ubuntu b/package/Dockerfile.ubuntu deleted file mode 100644 index 2d6a9bca..00000000 --- a/package/Dockerfile.ubuntu +++ /dev/null @@ -1,15 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ubuntu:22.04 -LABEL Description="CORE Docker Ubuntu Image" - -# define environment -ENV DEBIAN_FRONTEND=noninteractive - -# install basic dependencies -RUN apt-get update && apt-get install -y python3 python3-tk python3-pip python3-venv -RUN python3 -m pip install --upgrade pip - -# install core -WORKDIR /opt/core -COPY core_*.deb . -RUN apt-get install -y ./core_*.deb