updated dockerfiles to run commands to save space optimally
This commit is contained in:
parent
fec400ac2e
commit
d45eeb6d2e
8 changed files with 223 additions and 433 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue