From d45eeb6d2ebe74e1cc6629e07437114451694784 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 2 Mar 2023 08:34:54 -0800 Subject: [PATCH] updated dockerfiles to run commands to save space optimally --- dockerfiles/Dockerfile.centos | 86 ++++++++------- dockerfiles/Dockerfile.centos-optimal | 76 ------------- dockerfiles/Dockerfile.centos-package | 101 +++++++++++------- dockerfiles/Dockerfile.centos-package-optimal | 87 --------------- dockerfiles/Dockerfile.ubuntu | 78 ++++++++------ dockerfiles/Dockerfile.ubuntu-optimal | 62 ----------- dockerfiles/Dockerfile.ubuntu-package | 91 ++++++++++------ dockerfiles/Dockerfile.ubuntu-package-optimal | 75 ------------- 8 files changed, 223 insertions(+), 433 deletions(-) delete mode 100644 dockerfiles/Dockerfile.centos-optimal delete mode 100644 dockerfiles/Dockerfile.centos-package-optimal delete mode 100644 dockerfiles/Dockerfile.ubuntu-optimal delete mode 100644 dockerfiles/Dockerfile.ubuntu-package-optimal diff --git a/dockerfiles/Dockerfile.centos b/dockerfiles/Dockerfile.centos index 4de8604c..c8e8982b 100644 --- a/dockerfiles/Dockerfile.centos +++ b/dockerfiles/Dockerfile.centos @@ -2,40 +2,51 @@ FROM centos:7 LABEL Description="CORE Docker CentOS Image" -# define variables ARG PREFIX=/usr ARG BRANCH=master - -# define environment -ENV DEBIAN_FRONTEND=noninteractive ENV LANG en_US.UTF-8 +ARG PROTOC_VERSION=3.19.6 +ARG VENV_PATH=/opt/core/venv +ENV PATH="$PATH:${VENV_PATH}/bin" +WORKDIR /opt -# install basic dependencies +# install system dependencies RUN yum -y update && \ - yum install -y git sudo wget tzdata unzip + yum install -y \ + git \ + sudo \ + wget \ + tzdata \ + unzip \ + libpcap-devel \ + libpcre3-devel \ + libxml2-devel \ + protobuf-devel \ + unzip \ + uuid-devel \ + tcpdump \ + make && \ + yum-builddep -y python3 && \ + yum autoremove -y # 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 +RUN wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz && \ + tar xf Python-3.9.15.tgz && \ + cd Python-3.9.15 && \ + ./configure --enable-optimizations --with-ensurepip=install && \ + make -j$(nproc) altinstall && \ + python3.9 -m pip install --upgrade pip && \ + cd /opt && \ + rm -rf Python-3.9.15 # install core -WORKDIR /opt -RUN git clone https://github.com/coreemu/core -WORKDIR /opt/core -RUN git checkout ${BRANCH} -RUN PYTHON=/usr/local/bin/python3.9 ./setup.sh -RUN . /root/.bashrc && PYTHON=/usr/local/bin/python3.9 inv install -v -p ${PREFIX} --no-python -ENV PATH "$PATH:/opt/core/venv/bin" +RUN git clone https://github.com/coreemu/core && \ + cd core && \ + git checkout ${BRANCH} && \ + PYTHON=/usr/local/bin/python3.9 ./setup.sh && \ + . /root/.bashrc && PYTHON=/usr/local/bin/python3.9 inv install -v -p ${PREFIX} --no-python # 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 && \ @@ -45,18 +56,21 @@ RUN wget -q https://adjacentlink.com/downloads/emane/emane-1.3.3-release-1.el7.x 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.19.6/protoc-3.19.6-linux-x86_64.zip && \ +# install emane python bindings +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ mkdir protoc && \ - unzip protoc-3.19.6-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 . + unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ + git clone https://github.com/adjacentlink/emane.git && \ + cd emane && \ + git checkout v1.3.3 && \ + ./autogen.sh && \ + PYTHON=${VENV_PATH}/bin/python ./configure --prefix=/usr && \ + cd src/python && \ + PATH=/opt/protoc/bin:$PATH make && \ + ${VENV_PATH}/bin/python -m pip install . && \ + cd /opt && \ + rm -rf protoc && \ + rm -rf emane && \ + rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip -# run daemon -CMD ["core-daemon"] +WORKDIR /root diff --git a/dockerfiles/Dockerfile.centos-optimal b/dockerfiles/Dockerfile.centos-optimal deleted file mode 100644 index c8e8982b..00000000 --- a/dockerfiles/Dockerfile.centos-optimal +++ /dev/null @@ -1,76 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM centos:7 -LABEL Description="CORE Docker CentOS Image" - -ARG PREFIX=/usr -ARG BRANCH=master -ENV LANG en_US.UTF-8 -ARG PROTOC_VERSION=3.19.6 -ARG VENV_PATH=/opt/core/venv -ENV PATH="$PATH:${VENV_PATH}/bin" -WORKDIR /opt - -# install system dependencies -RUN yum -y update && \ - yum install -y \ - git \ - sudo \ - wget \ - tzdata \ - unzip \ - libpcap-devel \ - libpcre3-devel \ - libxml2-devel \ - protobuf-devel \ - unzip \ - uuid-devel \ - tcpdump \ - make && \ - yum-builddep -y python3 && \ - yum autoremove -y - -# install python3.9 -RUN wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz && \ - tar xf Python-3.9.15.tgz && \ - cd Python-3.9.15 && \ - ./configure --enable-optimizations --with-ensurepip=install && \ - make -j$(nproc) altinstall && \ - python3.9 -m pip install --upgrade pip && \ - cd /opt && \ - rm -rf Python-3.9.15 - -# install core -RUN git clone https://github.com/coreemu/core && \ - cd core && \ - git checkout ${BRANCH} && \ - PYTHON=/usr/local/bin/python3.9 ./setup.sh && \ - . /root/.bashrc && PYTHON=/usr/local/bin/python3.9 inv install -v -p ${PREFIX} --no-python - -# install emane -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 - -# install emane python bindings -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ - mkdir protoc && \ - unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ - git clone https://github.com/adjacentlink/emane.git && \ - cd emane && \ - git checkout v1.3.3 && \ - ./autogen.sh && \ - PYTHON=${VENV_PATH}/bin/python ./configure --prefix=/usr && \ - cd src/python && \ - PATH=/opt/protoc/bin:$PATH make && \ - ${VENV_PATH}/bin/python -m pip install . && \ - cd /opt && \ - rm -rf protoc && \ - rm -rf emane && \ - rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip - -WORKDIR /root diff --git a/dockerfiles/Dockerfile.centos-package b/dockerfiles/Dockerfile.centos-package index 3c1102b1..5c2366ed 100644 --- a/dockerfiles/Dockerfile.centos-package +++ b/dockerfiles/Dockerfile.centos-package @@ -2,40 +2,64 @@ FROM centos:7 LABEL Description="CORE CentOS Image" +ENV LANG en_US.UTF-8 +ARG PROTOC_VERSION=3.19.6 +ARG VENV_PATH=/opt/core/venv +ENV PATH="$PATH:${VENV_PATH}/bin" +WORKDIR /opt + # install basic dependencies -RUN yum update -y && yum install -y wget +RUN yum -y update && \ + yum install -y \ + git \ + sudo \ + wget \ + tzdata \ + unzip \ + libpcap-devel \ + libpcre3-devel \ + libxml2-devel \ + protobuf-devel \ + unzip \ + uuid-devel \ + tcpdump \ + automake \ + gawk \ + libreadline-devel \ + libtool \ + pkg-config \ + make && \ + yum-builddep -y python3 && \ + yum autoremove -y # 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 +RUN wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz && \ + tar xf Python-3.9.15.tgz && \ + cd Python-3.9.15 && \ + ./configure --enable-optimizations --with-ensurepip=install && \ + make -j$(nproc) altinstall && \ + python3.9 -m pip install --upgrade pip && \ + cd /opt && \ + rm -rf Python-3.9.15 # 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" +RUN PYTHON=/usr/local/bin/python3.9 yum install -y ./core_*.rpm && \ + rm -f core_*.rpm # 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 +RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \ + 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 && \ + cd /opt && \ + rm -rf ospf-mdr -# install emane -RUN yum install -y libpcap-devel libpcre3-devel libxml2-devel protobuf-devel unzip uuid-devel -WORKDIR /opt + # install emane 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 && \ @@ -44,15 +68,20 @@ RUN wget -q https://adjacentlink.com/downloads/emane/emane-1.3.3-release-1.el7.x 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.19.6/protoc-3.19.6-linux-x86_64.zip && \ + +# install emane python bindings +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ mkdir protoc && \ - unzip protoc-3.19.6-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 . + unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ + git clone https://github.com/adjacentlink/emane.git && \ + cd emane && \ + git checkout v1.3.3 && \ + ./autogen.sh && \ + PYTHON=${VENV_PATH}/bin/python ./configure --prefix=/usr && \ + cd src/python && \ + PATH=/opt/protoc/bin:$PATH make && \ + ${VENV_PATH}/bin/python -m pip install . && \ + cd /opt && \ + rm -rf protoc && \ + rm -rf emane && \ + rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip diff --git a/dockerfiles/Dockerfile.centos-package-optimal b/dockerfiles/Dockerfile.centos-package-optimal deleted file mode 100644 index 5c2366ed..00000000 --- a/dockerfiles/Dockerfile.centos-package-optimal +++ /dev/null @@ -1,87 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM centos:7 -LABEL Description="CORE CentOS Image" - -ENV LANG en_US.UTF-8 -ARG PROTOC_VERSION=3.19.6 -ARG VENV_PATH=/opt/core/venv -ENV PATH="$PATH:${VENV_PATH}/bin" -WORKDIR /opt - -# install basic dependencies -RUN yum -y update && \ - yum install -y \ - git \ - sudo \ - wget \ - tzdata \ - unzip \ - libpcap-devel \ - libpcre3-devel \ - libxml2-devel \ - protobuf-devel \ - unzip \ - uuid-devel \ - tcpdump \ - automake \ - gawk \ - libreadline-devel \ - libtool \ - pkg-config \ - make && \ - yum-builddep -y python3 && \ - yum autoremove -y - -# install python3.9 -RUN wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz && \ - tar xf Python-3.9.15.tgz && \ - cd Python-3.9.15 && \ - ./configure --enable-optimizations --with-ensurepip=install && \ - make -j$(nproc) altinstall && \ - python3.9 -m pip install --upgrade pip && \ - cd /opt && \ - rm -rf Python-3.9.15 - -# install core -COPY core_*.rpm . -RUN PYTHON=/usr/local/bin/python3.9 yum install -y ./core_*.rpm && \ - rm -f core_*.rpm - -# install ospf mdr -RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \ - 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 && \ - cd /opt && \ - rm -rf ospf-mdr - - # install emane -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 - -# install emane python bindings -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ - mkdir protoc && \ - unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ - git clone https://github.com/adjacentlink/emane.git && \ - cd emane && \ - git checkout v1.3.3 && \ - ./autogen.sh && \ - PYTHON=${VENV_PATH}/bin/python ./configure --prefix=/usr && \ - cd src/python && \ - PATH=/opt/protoc/bin:$PATH make && \ - ${VENV_PATH}/bin/python -m pip install . && \ - cd /opt && \ - rm -rf protoc && \ - rm -rf emane && \ - rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip diff --git a/dockerfiles/Dockerfile.ubuntu b/dockerfiles/Dockerfile.ubuntu index 9b1780e9..9762fd05 100644 --- a/dockerfiles/Dockerfile.ubuntu +++ b/dockerfiles/Dockerfile.ubuntu @@ -2,43 +2,61 @@ FROM ubuntu:22.04 LABEL Description="CORE Docker Ubuntu Image" -# define variables ARG PREFIX=/usr/local ARG BRANCH=master - -# define environment +ARG PROTOC_VERSION=3.19.6 +ARG VENV_PATH=/opt/core/venv ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="$PATH:${VENV_PATH}/bin" +WORKDIR /opt -# install basic dependencies -RUN apt-get update && \ - apt-get install -y git sudo wget tzdata +# install system dependencies +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + git \ + sudo \ + wget \ + tzdata \ + libpcap-dev \ + libpcre3-dev \ + libprotobuf-dev \ + libxml2-dev \ + protobuf-compiler \ + unzip \ + uuid-dev \ + iproute2 \ + iputils-ping \ + tcpdump && \ + apt-get autoremove -y # install core -WORKDIR /opt -RUN git clone https://github.com/coreemu/core -WORKDIR /opt/core -RUN git checkout ${BRANCH} -RUN ./setup.sh -RUN . /root/.bashrc && inv install -v -p ${PREFIX} -ENV PATH "$PATH:/opt/core/venv/bin" +RUN git clone https://github.com/coreemu/core && \ + cd core && \ + git checkout ${BRANCH} && \ + ./setup.sh && \ + . /root/.bashrc && \ + inv install -v -p ${PREFIX} && \ + cd /opt && \ + rm -rf ospf-mdr # install emane -RUN apt-get install -y libpcap-dev libpcre3-dev libprotobuf-dev libxml2-dev protobuf-compiler unzip 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 wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.6/protoc-3.19.6-linux-x86_64.zip && \ +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ mkdir protoc && \ - unzip protoc-3.19.6-linux-x86_64.zip -d protoc -RUN PATH=/opt/protoc/bin:$PATH && \ - cd emane/src/python && \ - make clean && \ - make -RUN /opt/core/venv/bin/python -m pip install emane/src/python + unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ + git clone https://github.com/adjacentlink/emane.git && \ + cd emane && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j$(nproc) && \ + make install && \ + cd src/python && \ + make clean && \ + PATH=/opt/protoc/bin:$PATH make && \ + ${VENV_PATH}/bin/python -m pip install . && \ + cd /opt && \ + rm -rf protoc && \ + rm -rf emane && \ + rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip -# run daemon -CMD ["core-daemon"] +WORKDIR /root diff --git a/dockerfiles/Dockerfile.ubuntu-optimal b/dockerfiles/Dockerfile.ubuntu-optimal deleted file mode 100644 index 9762fd05..00000000 --- a/dockerfiles/Dockerfile.ubuntu-optimal +++ /dev/null @@ -1,62 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ubuntu:22.04 -LABEL Description="CORE Docker Ubuntu Image" - -ARG PREFIX=/usr/local -ARG BRANCH=master -ARG PROTOC_VERSION=3.19.6 -ARG VENV_PATH=/opt/core/venv -ENV DEBIAN_FRONTEND=noninteractive -ENV PATH="$PATH:${VENV_PATH}/bin" -WORKDIR /opt - -# install system dependencies -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - git \ - sudo \ - wget \ - tzdata \ - libpcap-dev \ - libpcre3-dev \ - libprotobuf-dev \ - libxml2-dev \ - protobuf-compiler \ - unzip \ - uuid-dev \ - iproute2 \ - iputils-ping \ - tcpdump && \ - apt-get autoremove -y - -# install core -RUN git clone https://github.com/coreemu/core && \ - cd core && \ - git checkout ${BRANCH} && \ - ./setup.sh && \ - . /root/.bashrc && \ - inv install -v -p ${PREFIX} && \ - cd /opt && \ - rm -rf ospf-mdr - -# install emane -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ - mkdir protoc && \ - unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ - git clone https://github.com/adjacentlink/emane.git && \ - cd emane && \ - ./autogen.sh && \ - ./configure --prefix=/usr && \ - make -j$(nproc) && \ - make install && \ - cd src/python && \ - make clean && \ - PATH=/opt/protoc/bin:$PATH make && \ - ${VENV_PATH}/bin/python -m pip install . && \ - cd /opt && \ - rm -rf protoc && \ - rm -rf emane && \ - rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip - -WORKDIR /root diff --git a/dockerfiles/Dockerfile.ubuntu-package b/dockerfiles/Dockerfile.ubuntu-package index c23148e4..b8f66165 100644 --- a/dockerfiles/Dockerfile.ubuntu-package +++ b/dockerfiles/Dockerfile.ubuntu-package @@ -2,45 +2,74 @@ FROM ubuntu:22.04 LABEL Description="CORE Docker Ubuntu Image" -# define environment ENV DEBIAN_FRONTEND=noninteractive +ARG PROTOC_VERSION=3.19.6 +ARG VENV_PATH=/opt/core/venv +ENV PATH="$PATH:${VENV_PATH}/bin" +WORKDIR /opt # 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 +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + python3 \ + python3-tk \ + python3-pip \ + python3-venv \ + libpcap-dev \ + libpcre3-dev \ + libprotobuf-dev \ + libxml2-dev \ + protobuf-compiler \ + unzip \ + uuid-dev \ + automake \ + gawk \ + git \ + wget \ + libreadline-dev \ + libtool \ + pkg-config \ + g++ \ + make \ + iputils-ping \ + tcpdump && \ + apt-get autoremove -y # install core -WORKDIR /opt/core COPY core_*.deb . -RUN apt-get install -y ./core_*.deb -ENV PATH "$PATH:/opt/core/venv/bin" +RUN apt-get install -y ./core_*.deb && \ + rm -f core_*.deb # 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 +RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \ + 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 && \ + cd /opt && \ + rm -rf ospf-mdr # install emane -RUN apt-get install -y libpcap-dev libpcre3-dev libprotobuf-dev libxml2-dev protobuf-compiler unzip 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 wget https://github.com/protocolbuffers/protobuf/releases/download/v3.19.6/protoc-3.19.6-linux-x86_64.zip && \ +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ mkdir protoc && \ - unzip protoc-3.19.6-linux-x86_64.zip -d protoc -RUN PATH=/opt/protoc/bin:$PATH && \ - cd emane/src/python && \ - make clean && \ - make -RUN /opt/core/venv/bin/python -m pip install emane/src/python + unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ + git clone https://github.com/adjacentlink/emane.git && \ + cd emane && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make -j$(nproc) && \ + make install && \ + cd src/python && \ + make clean && \ + PATH=/opt/protoc/bin:$PATH make && \ + ${VENV_PATH}/bin/python -m pip install . && \ + cd /opt && \ + rm -rf protoc && \ + rm -rf emane && \ + rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip + +WORKDIR /root diff --git a/dockerfiles/Dockerfile.ubuntu-package-optimal b/dockerfiles/Dockerfile.ubuntu-package-optimal deleted file mode 100644 index b8f66165..00000000 --- a/dockerfiles/Dockerfile.ubuntu-package-optimal +++ /dev/null @@ -1,75 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ubuntu:22.04 -LABEL Description="CORE Docker Ubuntu Image" - -ENV DEBIAN_FRONTEND=noninteractive -ARG PROTOC_VERSION=3.19.6 -ARG VENV_PATH=/opt/core/venv -ENV PATH="$PATH:${VENV_PATH}/bin" -WORKDIR /opt - -# install basic dependencies -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - python3 \ - python3-tk \ - python3-pip \ - python3-venv \ - libpcap-dev \ - libpcre3-dev \ - libprotobuf-dev \ - libxml2-dev \ - protobuf-compiler \ - unzip \ - uuid-dev \ - automake \ - gawk \ - git \ - wget \ - libreadline-dev \ - libtool \ - pkg-config \ - g++ \ - make \ - iputils-ping \ - tcpdump && \ - apt-get autoremove -y - -# install core -COPY core_*.deb . -RUN apt-get install -y ./core_*.deb && \ - rm -f core_*.deb - -# install ospf mdr -RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \ - 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 && \ - cd /opt && \ - rm -rf ospf-mdr - -# install emane -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ - mkdir protoc && \ - unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \ - git clone https://github.com/adjacentlink/emane.git && \ - cd emane && \ - ./autogen.sh && \ - ./configure --prefix=/usr && \ - make -j$(nproc) && \ - make install && \ - cd src/python && \ - make clean && \ - PATH=/opt/protoc/bin:$PATH make && \ - ${VENV_PATH}/bin/python -m pip install . && \ - cd /opt && \ - rm -rf protoc && \ - rm -rf emane && \ - rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip - -WORKDIR /root