install: updated and added dockerfiles for ubuntu/centos, updated notes on install page to correlate

This commit is contained in:
Blake Harnden 2022-05-25 21:43:52 -07:00
parent 2e3e085522
commit 28d3deeee8
4 changed files with 75 additions and 102 deletions

View file

@ -1,100 +0,0 @@
# syntax=docker/dockerfile:1
FROM ubuntu:20.04
LABEL Description="CORE Docker Image"
# define variables
ARG DEBIAN_FRONTEND=noninteractive
ARG PREFIX=/usr/local
ARG BRANCH=master
ARG CORE_TARBALL=core.tar.gz
ARG OSPF_TARBALL=ospf.tar.gz
# install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
automake \
bash \
ca-certificates \
ethtool \
gawk \
gcc \
g++ \
iproute2 \
iputils-ping \
libc-dev \
libev-dev \
libreadline-dev \
libtool \
libtk-img \
make \
nftables \
python3 \
python3-pip \
python3-tk \
pkg-config \
systemctl \
tk \
wget \
xauth \
xterm \
&& apt-get clean
# install python dependencies
RUN python3 -m pip install \
grpcio==1.27.2 \
grpcio-tools==1.27.2 \
poetry==1.1.7
# retrieve, build, and install core
RUN wget -q -O ${CORE_TARBALL} https://api.github.com/repos/coreemu/core/tarball/${BRANCH} && \
tar xf ${CORE_TARBALL} && \
cd coreemu-core* && \
./bootstrap.sh && \
./configure && \
make -j $(nproc) && \
make install && \
cd daemon && \
python3 -m poetry build -f wheel && \
python3 -m pip install dist/* && \
cp scripts/* ${PREFIX}/bin && \
mkdir /etc/core && \
cp -n data/core.conf /etc/core && \
cp -n data/logging.conf /etc/core && \
mkdir -p ${PREFIX}/share/core && \
cp -r examples ${PREFIX}/share/core && \
echo '\
[Unit]\n\
Description=Common Open Research Emulator Service\n\
After=network.target\n\
\n\
[Service]\n\
Type=simple\n\
ExecStart=/usr/local/bin/core-daemon\n\
TasksMax=infinity\n\
\n\
[Install]\n\
WantedBy=multi-user.target\
' > /lib/systemd/system/core-daemon.service && \
cd ../.. && \
rm ${CORE_TARBALL} && \
rm -rf coreemu-core*
# retrieve, build, and install ospf mdr
RUN wget -q -O ${OSPF_TARBALL} https://github.com/USNavalResearchLaboratory/ospf-mdr/tarball/master && \
tar xf ${OSPF_TARBALL} && \
cd USNavalResearchLaboratory-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 .. && \
rm ${OSPF_TARBALL} && \
rm -rf USNavalResearchLaboratory-ospf-mdr*
# retrieve and install emane packages
RUN wget -q https://adjacentlink.com/downloads/emane/emane-1.2.7-release-1.ubuntu-20_04.amd64.tar.gz && \
tar xf emane*.tar.gz && \
cd emane-1.2.7-release-1/debs/ubuntu-20_04/amd64 && \
apt-get install -y ./emane*.deb ./python3-emane_*.deb && \
cd ../../../.. && \
rm emane-1.2.7-release-1.ubuntu-20_04.amd64.tar.gz && \
rm -rf emane-1.2.7-release-1
CMD ["systemctl", "start", "core-daemon"]

39
Dockerfile.centos Normal file
View file

@ -0,0 +1,39 @@
# 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
# install core
RUN yum -y update && \
yum install -y git sudo wget tzdata unzip python3
WORKDIR /root
RUN git clone https://github.com/coreemu/core
WORKDIR /root/core
RUN git checkout ${BRANCH}
RUN ./setup.sh
RUN . /root/.bashrc && inv install -v -p ${PREFIX}
# install emane packages and python bindings
WORKDIR /root
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
WORKDIR /root/core
RUN . /root/.bashrc && PATH=/root/protoc/bin:$PATH inv install-emane -v -e v1.3.3
# run daemon
CMD ["core-daemon"]

34
Dockerfile.ubuntu Normal file
View file

@ -0,0 +1,34 @@
# syntax=docker/dockerfile:1
FROM ubuntu:20.04
LABEL Description="CORE Docker Ubuntu Image"
# define variables
ARG PREFIX=/usr/local
ARG BRANCH=master
# define environment
ENV DEBIAN_FRONTEND=noninteractive
# install core
RUN apt-get update && \
apt-get install -y git sudo wget tzdata
WORKDIR /root
RUN git clone https://github.com/coreemu/core
WORKDIR /root/core
RUN git checkout ${BRANCH}
RUN ./setup.sh
RUN . /root/.bashrc && inv install -v -p ${PREFIX}
# install emane packages and python bindings
WORKDIR /root
RUN wget -q https://adjacentlink.com/downloads/emane/emane-1.3.3-release-1.ubuntu-20_04.amd64.tar.gz && \
tar xf emane*.tar.gz && \
cd emane-1.3.3-release-1/debs/ubuntu-20_04/amd64 && \
apt-get install -y ./emane*.deb ./python3-emane_*.deb && \
cd ../../../.. && \
rm emane-1.3.3-release-1.ubuntu-20_04.amd64.tar.gz && \
rm -rf emane-1.3.3-release-1
WORKDIR /root/core
RUN . /root/.bashrc && inv install-emane -v -e v1.3.3
# run daemon
CMD ["core-daemon"]

View file

@ -218,9 +218,9 @@ You can leverage the provided Dockerfile, to run and launch CORE within a Docker
git clone https://github.com/coreemu/core.git git clone https://github.com/coreemu/core.git
cd core cd core
# build image # build image
sudo docker build -t core . sudo docker build -t core.<cenots,ubuntu> -f Dockerfile.<centos,ubuntu>
# start container # start container
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged core sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged core.<centos,ubuntu>
# enable xhost access to the root user # enable xhost access to the root user
xhost +local:root xhost +local:root
# launch core-gui # launch core-gui