2022-05-26 05:43:52 +01:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
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
|
|
|
|
|
2022-10-14 18:42:31 +01:00
|
|
|
# install basic dependencies
|
2022-05-26 05:43:52 +01:00
|
|
|
RUN yum -y update && \
|
2022-10-14 18:42:31 +01:00
|
|
|
yum install -y git sudo wget tzdata unzip
|
|
|
|
|
|
|
|
# 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
|
2022-05-26 05:43:52 +01:00
|
|
|
RUN git clone https://github.com/coreemu/core
|
2022-10-14 18:42:31 +01:00
|
|
|
WORKDIR /opt/core
|
2022-05-26 05:43:52 +01:00
|
|
|
RUN git checkout ${BRANCH}
|
2022-10-14 18:42:31 +01:00
|
|
|
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"
|
|
|
|
|
|
|
|
# install emane
|
|
|
|
RUN yum install -y libpcap-devel libpcre3-devel libxml2-devel protobuf-devel unzip uuid-devel
|
|
|
|
WORKDIR /opt
|
2022-05-26 05:43:52 +01:00
|
|
|
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
|
2022-10-14 18:42:31 +01:00
|
|
|
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 .
|
2022-05-26 05:43:52 +01:00
|
|
|
|
|
|
|
# run daemon
|
|
|
|
CMD ["core-daemon"]
|