From 56a0511f2140e9fd9aa6ecb3ff835d4c80bbb13f Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Thu, 21 Sep 2023 18:54:08 +0100 Subject: [PATCH] updated to 9.0.3 --- dockerfiles/Dockerfile.ubuntu => Dockerfile | 69 +++++++++- README.md | 137 +++++++++++++------- 2 files changed, 157 insertions(+), 49 deletions(-) rename dockerfiles/Dockerfile.ubuntu => Dockerfile (58%) diff --git a/dockerfiles/Dockerfile.ubuntu b/Dockerfile similarity index 58% rename from dockerfiles/Dockerfile.ubuntu rename to Dockerfile index 8eceebf7..08f5e548 100644 --- a/dockerfiles/Dockerfile.ubuntu +++ b/Dockerfile @@ -11,9 +11,72 @@ ENV PATH="$PATH:${VENV_PATH}/bin" WORKDIR /opt # install system dependencies + +RUN apt-get update -y && \ + apt-get install -y software-properties-common + +RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy universe" + RUN apt-get update -y && \ 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 \ + nftables \ + python3 \ + python3-pip \ + python3-tk \ + pkg-config \ + tk \ + xauth \ + xterm \ + vim \ + build-essential \ + nano \ + firefox \ + net-tools \ + rsync \ + openssh-server \ + openssh-client \ + vsftpd \ + atftpd \ + atftp \ + mini-httpd \ + lynx \ + tcpdump \ + wireshark \ + iperf \ + iperf3 \ + tshark \ + openssh-sftp-server \ + bind9 \ + bind9-utils \ + openvpn \ + isc-dhcp-server \ + isc-dhcp-client \ + whois \ + ipcalc \ + socat \ + hping3 \ + libgtk-3-0 \ + librest-0.7-0 \ + libgtk-3-common \ + dconf-gsettings-backend \ + libsoup-gnome2.4-1 \ + libsoup2.4-1 \ + dconf-service \ + x11-xserver-utils \ + ftp \ git \ sudo \ wget \ @@ -26,8 +89,8 @@ RUN apt-get update -y && \ unzip \ uuid-dev \ iproute2 \ - iputils-ping \ - tcpdump && \ + vlc \ + iputils-ping && \ apt-get autoremove -y # install core @@ -59,3 +122,5 @@ RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip WORKDIR /root + +CMD /opt/core/venv/bin/core-daemon diff --git a/README.md b/README.md index b0aa133f..efab2e70 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,107 @@ +# Index +- CORE +- Docker Setup + - Precompiled container image + - Build container image from source + - Adding extra packages + +- Useful commands +- License + # CORE + CORE: Common Open Research Emulator Copyright (c)2005-2022 the Boeing Company. See the LICENSE file included in this distribution. -## About -The Common Open Research Emulator (CORE) is a tool for emulating -networks on one or more machines. You can connect these emulated -networks to live networks. CORE consists of a GUI for drawing -topologies of lightweight virtual machines, and Python modules for -scripting network emulation. +# Docker Setup -## Quick Start -Requires Python 3.9+. More detailed instructions and install options can be found -[here](https://coreemu.github.io/core/install.html). +Here you have 2 choices -### Package Install -Grab the latest deb/rpm from [releases](https://github.com/coreemu/core/releases). +## Precompiled container image + +```bash + +# Start container +sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged --restart unless-stopped git.olympuslab.net/afonso/core-extra:latest + +``` +## Build container image from source + +```bash +# Clone the repo +git clone https://gitea.olympuslab.net/afonso/core-extra.git + +# cd into the directory +cd core-extra + +# build the docker image +sudo docker build -t core-extra . + +# start container +sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged --restart unless-stopped core-extra -This will install vnoded/vcmd, system dependencies, and CORE within a python -virtual environment at `/opt/core/venv`. -```shell -sudo install -y ./ ``` -Then install OSPF MDR from source: -```shell -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) -sudo make install +### Adding extra packages + +To add extra packages you must modify the Dockerfile and then compile the docker image. +If you install it after starting the container it will, by docker nature, be reverted on the next boot of the container. + +# Useful commands + +I have the following functions on my fish shell +to help me better use core + +THIS ONLY WORKS ON FISH, MODIFY FOR BASH OR ZSH + +```fish + +# RUN CORE GUI +function core + xhost +local:root + sudo docker exec -it core core-gui +end + +# RUN BASH INSIDE THE CONTAINER +function core-bash + sudo docker exec -it core /bin/bash +end + + +# LAUNCH NODE BASH ON THE HOST MACHINE +function launch-term --argument nodename + sudo docker exec -it core xterm -bg black -fg white -fa 'DejaVu Sans Mono' -fs 16 -e vcmd -c /tmp/pycore.1/$nodename -- /bin/bash +end + +#TO RUN ANY OTHER COMMAND +sudo docker exec -it core COMAND_GOES_HERE + ``` -### Script Install -The following should get you up and running on Ubuntu 22.04. This would -install CORE into a python3 virtual environment and install -[OSPF MDR](https://github.com/USNavalResearchLaboratory/ospf-mdr) from source. +## LICENSE -```shell -git clone https://github.com/coreemu/core.git -cd core -# install dependencies to run installation task -./setup.sh -# run the following or open a new terminal -source ~/.bashrc -# Ubuntu -inv install -# CentOS -inv install -p /usr -``` +Copyright (c) 2005-2018, the Boeing Company. -## Documentation & Support -We are leveraging GitHub hosted documentation and Discord for persistent -chat rooms. This allows for more dynamic conversations and the -capability to respond faster. Feel free to join us at the link below. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -* [Documentation](https://coreemu.github.io/core/) -* [Discord Channel](https://discord.gg/AKd7kmP) +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE.