Skip to content

Commit 29f38c5

Browse files
committed
adjustments to separate github and local containerfiles, added containerfiles to support frr installation, added convenience script to bring up container, initial adjustments to help fix frr to working state
1 parent 5516d1c commit 29f38c5

17 files changed

Lines changed: 437 additions & 128 deletions

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git
2+
venv
3+
.venv
4+
.gitignore
5+
dist
6+
__pycache__
7+
.idea
8+
.vscode
9+
*.swp
10+
*.pyc

containerfiles/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
This provides a brief overview of using the containerfiles provided to help build CORE
44
and parts related to it. You should be able to use docker/podman interchangeably.
55

6-
## Build CORE Packages
6+
## Building Local
77

8-
There is a Containerfile to help support building CORE packages, using
9-
the latest from a given branch. The environment helps ensure we use an older
10-
version of glibc to avoid incompatibilities.
8+
These Containerfiles are dependent on building against a local CORE python package
9+
built against the currently checked out source code. You will need to build images
10+
in proper order to ensure expected artifacts are available.
1111

1212
```shell
13-
<docker|podman> build -t core-package -f Containerfile.core-package .
14-
15-
# optionally change BRANCH used when building
16-
<docker|podman> build -t core-package --build-arg BRANCH=develop -f Containerfile.core-package .
17-
```
13+
# build emane python package
14+
<docker|podman> build -t emane-python -f Containerfile.emane-python .
1815

19-
## EMANE Python Bindings
16+
# build core package from current source code
17+
<docker|podman> build -t core-package -f local/Containerfile.core-package ..
2018

21-
There is a Containerfile to help build EMANE python bindings, which are needed to install
22-
into the CORE virtual environment to support certain EMANE interactions.
19+
# optionally you can build the core package against source, providing a branch if desired
20+
<docker|podman> build -t core-package --build-arg BRANCH=develop -f github/Containerfile.core-package .
2321

24-
```shell
25-
<docker|podman> build -t emane-python -f Containerfile.emane-python .
22+
# build variation of a CORE image (rocky, ubuntu, or frr variations)
23+
<docker|podman> build -t core -f local/Containerfile.<type> .
2624
```
2725

28-
## Rocky/Ubuntu Containers
26+
## Building from GitHub
2927

30-
There a Containerfile to help build and provide a full containerized environment that is inclusive
31-
of CORE, EMANE, and OSPF MDR for both Ubuntu and Rocky Linux.
28+
These Containerfiles build against packages direct from GitHub.
3229

3330
```shell
34-
<docker|podman> build -t core-rocky -f Containerfile.rocky .
35-
<docker|podman> build -t core-ubuntu -f Containerfile.ubuntu .
31+
# build emane python package
32+
<docker|podman> build -t emane-python -f Containerfile.emane-python .
33+
34+
# build variation of a CORE image (rocky, ubuntu, or frr variations)
35+
<docker|podman> build -t core -f github/Containerfile.<type> .
3636
```
3737

3838
## Image Tagging for GitHub
File renamed without changes.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ RUN dnf update -y && \
5353
dnf autoremove -y && \
5454
dnf clean all
5555

56-
# install core
57-
ARG CORE_VERSION=9.2.1
58-
ARG CORE_PACKAGE=core_${CORE_VERSION}_x86_64.rpm
59-
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
60-
RUN dnf update -y && \
61-
wget -q ${PACKAGE_URL} && \
62-
PYTHON=$(uv python find ${PYTHON_VERSION}) dnf install -y ./${CORE_PACKAGE} && \
63-
rm -f ${CORE_PACKAGE} && \
64-
dnf autoremove -y && \
65-
dnf clean all
66-
6756
# install ospf mdr
6857
COPY --from=ospf-rpm /opt/quagga-mr-0.99*.rpm .
6958
RUN dnf update -y && \
@@ -90,6 +79,17 @@ RUN dnf update -y && \
9079
dnf autoremove -y && \
9180
dnf clean all
9281

82+
# install core
83+
ARG CORE_VERSION=9.2.1
84+
ARG CORE_PACKAGE=core_${CORE_VERSION}_x86_64.rpm
85+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
86+
RUN dnf update -y && \
87+
wget -q ${PACKAGE_URL} && \
88+
PYTHON=$(uv python find ${PYTHON_VERSION}) dnf install -y ./${CORE_PACKAGE} && \
89+
rm -f ${CORE_PACKAGE} && \
90+
dnf autoremove -y && \
91+
dnf clean all
92+
9393
# install emane python bindings with dependencies
9494
ARG VENV_PATH=/opt/core/venv
9595
COPY --from=emane-python /opt/emane-*.whl .
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# syntax=docker/dockerfile:1
2+
FROM rockylinux/rockylinux:9 AS ospf-rpm
3+
WORKDIR /opt
4+
RUN dnf update -y && \
5+
dnf install -y epel-release dnf-plugins-core && \
6+
dnf config-manager --set-enabled crb && \
7+
dnf update -y && \
8+
dnf install -y \
9+
texinfo \
10+
rpm-build \
11+
texlive-base \
12+
texinfo-tex \
13+
texi2html \
14+
readline-devel \
15+
libpcap-devel \
16+
ImageMagick \
17+
git \
18+
automake \
19+
libtool \
20+
pkg-config \
21+
gcc-c++ \
22+
libcap-devel \
23+
make && \
24+
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \
25+
cd ospf-mdr && \
26+
./bootstrap.sh && \
27+
./configure && \
28+
(make -f quagga.rpm.mk build || make -f quagga.rpm.mk build) && \
29+
mv .rpmbuild/RPMS/x86_64/quagga-mr-0.99*.rpm /opt/ && \
30+
cd /opt && \
31+
rm -rf ospf-mdr && \
32+
dnf autoremove -y && \
33+
dnf clean all
34+
35+
FROM rockylinux/rockylinux:9
36+
COPY --from=ghcr.io/astral-sh/uv:0.9.22 /uv /uvx /bin/
37+
ENV LANG=en_US.UTF-8
38+
ENV PATH="/root/.local/bin:${PATH}"
39+
WORKDIR /opt
40+
41+
# install python
42+
ARG PYTHON_VERSION=3.13
43+
RUN uv python install ${PYTHON_VERSION}
44+
45+
# install system dependencies
46+
RUN dnf update -y && \
47+
dnf install -y \
48+
xterm \
49+
wget \
50+
tcpdump \
51+
tk \
52+
iproute-tc && \
53+
dnf autoremove -y && \
54+
dnf clean all
55+
56+
# install frr
57+
ARG FRRVER="frr-stable"
58+
RUN curl -O https://rpm.frrouting.org/repo/$FRRVER-repo.el9.noarch.rpm && \
59+
dnf update -y && \
60+
dnf install -y ./$FRRVER* && \
61+
dnf install -y frr frr-pythontools && \
62+
rm -f $FRRVER-repo.el9.noarch.rpm && \
63+
dnf autoremove -y && \
64+
dnf clean all
65+
ENV PATH="/usr/lib/frr:$PATH"
66+
67+
# install emane
68+
ARG EMANE_VERSION=1.5.3
69+
ARG EMANE_RELEASE=emane-${EMANE_VERSION}-release-1
70+
ARG EMANE_PACKAGE=${EMANE_RELEASE}.el9.x86_64.tar.gz
71+
RUN dnf update -y && \
72+
wget -q https://adjacentlink.com/downloads/emane/${EMANE_PACKAGE} && \
73+
tar xf ${EMANE_PACKAGE} && \
74+
cd ${EMANE_RELEASE}/rpms/el9/x86_64 && \
75+
rm emane-spectrum-tools-*.rpm emane-model-lte*.rpm && \
76+
rm *devel*.rpm && \
77+
dnf install -y ./emane*.rpm ./python3-emane-${EMANE_VERSION}-1.el9.noarch.rpm && \
78+
cd ../../../.. && \
79+
rm ${EMANE_PACKAGE} && \
80+
rm -rf ${EMANE_RELEASE} && \
81+
dnf autoremove -y && \
82+
dnf clean all
83+
84+
# install core
85+
ARG CORE_VERSION=9.2.1
86+
ARG CORE_PACKAGE=core_${CORE_VERSION}_x86_64.rpm
87+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
88+
RUN dnf update -y && \
89+
wget -q ${PACKAGE_URL} && \
90+
PYTHON=$(uv python find ${PYTHON_VERSION}) dnf install -y ./${CORE_PACKAGE} && \
91+
rm -f ${CORE_PACKAGE} && \
92+
dnf autoremove -y && \
93+
dnf clean all
94+
95+
# install emane python bindings with dependencies
96+
ARG VENV_PATH=/opt/core/venv
97+
COPY --from=emane-python /opt/emane-*.whl .
98+
RUN uv pip install --python ${VENV_PATH} 'setuptools<81' ./emane-*.whl && \
99+
rm -f ./emane-*.whl
100+
101+
# set default directory
102+
WORKDIR /root

containerfiles/Containerfile.ubuntu renamed to containerfiles/github/Containerfile.ubuntu

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
# syntax=docker/dockerfile:1
2-
FROM ubuntu:24.04 AS ospf-deb
3-
WORKDIR /opt
4-
RUN apt-get update -y && \
5-
apt-get install -y --no-install-recommends \
6-
git \
7-
ca-certificates \
8-
automake \
9-
make \
10-
libtool \
11-
pkg-config \
12-
gawk \
13-
g++ \
14-
dpkg-dev \
15-
debhelper \
16-
libreadline-dev \
17-
texinfo \
18-
imagemagick \
19-
groff \
20-
build-essential:native \
21-
texlive-latex-recommended \
22-
texlive-plain-generic && \
23-
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \
24-
cd ospf-mdr && \
25-
./bootstrap.sh && \
26-
./configure && \
27-
(make -f quagga.deb.mk build || make -f quagga.deb.mk build) && \
28-
mv quagga-mr_0.99*.deb /opt/ && \
29-
cd /opt && \
30-
rm -rf ospf-mdr && \
31-
apt-get autoremove -y && \
32-
rm -rf /var/lib/apt/lists/*
33-
342
FROM ubuntu:24.04
353
COPY --from=ghcr.io/astral-sh/uv:0.9.22 /uv /uvx /bin/
364
ENV DEBIAN_FRONTEND=noninteractive
@@ -55,17 +23,6 @@ RUN apt-get update -y && \
5523
apt-get autoremove -y && \
5624
rm -rf /var/lib/apt/lists/*
5725

58-
# install core
59-
ARG CORE_VERSION=9.2.1
60-
ARG CORE_PACKAGE=core_${CORE_VERSION}_amd64.deb
61-
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
62-
RUN apt-get update -y && \
63-
wget -q ${PACKAGE_URL} && \
64-
PYTHON=$(uv python find ${PYTHON_VERSION}) apt-get install -y --no-install-recommends ./${CORE_PACKAGE} && \
65-
rm -f ${CORE_PACKAGE} && \
66-
apt-get autoremove -y && \
67-
rm -rf /var/lib/apt/lists/*
68-
6926
# install ospf mdr
7027
RUN apt-get update -y && \
7128
apt-get install -y --no-install-recommends \
@@ -107,6 +64,17 @@ RUN apt-get update -y && \
10764
apt-get autoremove -y && \
10865
rm -rf /var/lib/apt/lists/*
10966

67+
# install core
68+
ARG CORE_VERSION=9.2.1
69+
ARG CORE_PACKAGE=core_${CORE_VERSION}_amd64.deb
70+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
71+
RUN apt-get update -y && \
72+
wget -q ${PACKAGE_URL} && \
73+
PYTHON=$(uv python find ${PYTHON_VERSION}) apt-get install -y --no-install-recommends ./${CORE_PACKAGE} && \
74+
rm -f ${CORE_PACKAGE} && \
75+
apt-get autoremove -y && \
76+
rm -rf /var/lib/apt/lists/*
77+
11078
# install emane python bindings with dependencies
11179
ARG VENV_PATH=/opt/core/venv
11280
COPY --from=emane-python /opt/emane-*.whl .
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# syntax=docker/dockerfile:1
2+
FROM ubuntu:24.04
3+
COPY --from=ghcr.io/astral-sh/uv:0.9.22 /uv /uvx /bin/
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV PATH="/root/.local/bin:${PATH}"
6+
WORKDIR /opt
7+
8+
# install python
9+
ARG PYTHON_VERSION=3.13
10+
RUN uv python install ${PYTHON_VERSION}
11+
12+
# install system dependencies
13+
RUN apt-get update -y && \
14+
apt-get install -y --no-install-recommends \
15+
ca-certificates \
16+
curl \
17+
lsb-release \
18+
xterm \
19+
psmisc \
20+
tk \
21+
wget \
22+
iproute2 \
23+
iputils-ping \
24+
tcpdump && \
25+
apt-get autoremove -y && \
26+
rm -rf /var/lib/apt/lists/*
27+
28+
# install frr
29+
ARG FRRVER="frr-stable"
30+
RUN curl -s https://deb.frrouting.org/frr/keys.gpg | tee /usr/share/keyrings/frrouting.gpg > /dev/null && \
31+
echo deb '[signed-by=/usr/share/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr $(lsb_release -s -c) $FRRVER | tee -a /etc/apt/sources.list.d/frr.list && \
32+
apt-get update -y && \
33+
apt-get install -y frr frr-pythontools && \
34+
apt-get autoremove -y && \
35+
rm -rf /var/lib/apt/lists/*
36+
ENV PATH="/usr/lib/frr:$PATH"
37+
38+
# install emane
39+
ARG EMANE_VERSION=1.5.3
40+
ARG EMANE_RELEASE=emane-${EMANE_VERSION}-release-1
41+
ARG EMANE_PACKAGE=${EMANE_RELEASE}.ubuntu-24_04.amd64.tar.gz
42+
RUN apt-get update -y && \
43+
wget -q https://adjacentlink.com/downloads/emane/${EMANE_PACKAGE} && \
44+
tar xf ${EMANE_PACKAGE} && \
45+
cd ${EMANE_RELEASE}/debs/ubuntu-24_04/amd64 && \
46+
rm emane-spectrum-tools*.deb emane-model-lte*.deb && \
47+
rm *dev*.deb && \
48+
apt-get install -y --no-install-recommends ./emane*.deb ./python3-emane_*.deb && \
49+
cd ../../../.. && \
50+
rm ${EMANE_PACKAGE} && \
51+
rm -rf ${EMANE_RELEASE} && \
52+
apt-get autoremove -y && \
53+
rm -rf /var/lib/apt/lists/*
54+
55+
# install core
56+
ARG CORE_VERSION=9.2.1
57+
ARG CORE_PACKAGE=core_${CORE_VERSION}_amd64.deb
58+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/download/release-${CORE_VERSION}/${CORE_PACKAGE}
59+
RUN apt-get update -y && \
60+
wget -q ${PACKAGE_URL} && \
61+
PYTHON=$(uv python find ${PYTHON_VERSION}) apt-get install -y --no-install-recommends ./${CORE_PACKAGE} && \
62+
rm -f ${CORE_PACKAGE} && \
63+
apt-get autoremove -y && \
64+
rm -rf /var/lib/apt/lists/*
65+
66+
# install emane python bindings with dependencies
67+
ARG VENV_PATH=/opt/core/venv
68+
COPY --from=emane-python /opt/emane-*.whl .
69+
RUN uv pip install --python ${VENV_PATH} 'setuptools<81' ./emane-*.whl && \
70+
rm -f ./emane-*.whl
71+
72+
# set default directory
73+
WORKDIR /root
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# syntax=docker/dockerfile:1
2+
FROM ubuntu:20.04
3+
COPY --from=ghcr.io/astral-sh/uv:0.9.22 /uv /uvx /bin/
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV PATH="/root/.local/bin:${PATH}"
6+
7+
# install system dependencies
8+
RUN apt-get update -y && \
9+
apt-get install -y --no-install-recommends \
10+
automake \
11+
pkg-config \
12+
libev-dev \
13+
nftables \
14+
iproute2 \
15+
ethtool \
16+
tk \
17+
bash \
18+
gem \
19+
rpm \
20+
ruby \
21+
ca-certificates \
22+
build-essential \
23+
git && \
24+
apt-get autoremove -y && \
25+
rm -rf /var/lib/apt/lists/*
26+
27+
# install fpm dependencies
28+
ARG DOTENV_VERSION=2.8.1
29+
RUN gem install dotenv -v ${DOTENV_VERSION} && \
30+
gem install fpm
31+
32+
# copy and build core
33+
WORKDIR /opt/core
34+
COPY . .
35+
RUN ./setup.sh && \
36+
./bootstrap.sh && \
37+
PYTHON=$PWD/daemon/.venv/bin/python ./configure --prefix=/usr && \
38+
make -j$(nproc) && \
39+
make fpm

0 commit comments

Comments
 (0)