Compare commits
4 Commits
49b8df9709
...
main
Author | SHA1 | Date | |
---|---|---|---|
ea8cd89de9 | |||
2b03aad9bc | |||
17c3977873 | |||
e5889b22e2 |
29
README.md
29
README.md
@ -91,13 +91,28 @@ bind-mount `/etc/vpp/bootstrap.vpp`.
|
|||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
To build, this container uses Docker's `buildx`, for which on Debian Bookworm it's required to use
|
||||||
|
the upstream (docker.com) packages described [[here](https://docs.docker.com/engine/install/debian/)].
|
||||||
|
To allow the buildx to build for multi-arch, it's also required to install the Qemu `binfmt`
|
||||||
|
emulators, with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --privileged --rm tonistiigi/binfmt --install all
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, ongoing builds can be cross-platform and take about 1500 seconds on an AMD64 i7-12700T
|
||||||
|
The buildx invocation will build 'latest' and then tag it with the current VPP package release,
|
||||||
|
which you can get from `vppcfg show version`, like so:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
IMG=git.ipng.ch/ipng/vpp-containerlab
|
IMG=git.ipng.ch/ipng/vpp-containerlab
|
||||||
TAG=latest
|
TAG=latest
|
||||||
docker build --no-cache --build-arg REPO=release -f docker/Dockerfile.bookworm -t $IMG docker/
|
docker buildx build --push --platform linux/arm64,linux/amd64 \
|
||||||
docker image tag $IMG $IMG:$TAG
|
--tag $IMG:$TAG -f docker/Dockerfile docker/
|
||||||
docker push $IMG
|
|
||||||
docker push $IMG:$TAG
|
TAG=v25.02-release
|
||||||
|
docker buildx build --push --platform linux/arm64,linux/amd64 \
|
||||||
|
--tag $IMG:$TAG -f docker/Dockerfile docker/
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing standalone container
|
### Testing standalone container
|
||||||
@ -110,7 +125,7 @@ docker run --cap-add=NET_ADMIN --cap-add=SYS_NICE --cap-add=SYS_PTRACE \
|
|||||||
--device=/dev/net/tun:/dev/net/tun \
|
--device=/dev/net/tun:/dev/net/tun \
|
||||||
--device=/dev/vhost-net:/dev/vhost-net \
|
--device=/dev/vhost-net:/dev/vhost-net \
|
||||||
--privileged --name clab-pim \
|
--privileged --name clab-pim \
|
||||||
docker.io/pimvanpelt/vpp-containerlab:latest
|
git.ipng.ch/ipng/vpp-containerlab:latest
|
||||||
docker network connect clab-network clab-pim
|
docker network connect clab-network clab-pim
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -172,7 +187,3 @@ Containerlab will attach these `veth` pairs to the container, and replace our Do
|
|||||||
that waits for all of these interfaces to be added (typically called `if-wait.sh`). In our own CMD,
|
that waits for all of these interfaces to be added (typically called `if-wait.sh`). In our own CMD,
|
||||||
we then generate a config file called `/etc/vpp/clab.vpp` which contains the necessary VPP commands
|
we then generate a config file called `/etc/vpp/clab.vpp` which contains the necessary VPP commands
|
||||||
to take control over these `veth` pairs.
|
to take control over these `veth` pairs.
|
||||||
|
|
||||||
In addition, you can add more commands that'll execute on startup by copying in
|
|
||||||
`/etc/vpp/manual-pre.vpp` (to be executed _before_ the containerlab stuff) or
|
|
||||||
`/etc/vpp/manual-post.vpp` (to be executed _after_ the containerlab stuff).
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM debian:bookworm
|
FROM ubuntu:noble
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ARG VPP_INSTALL_SKIP_SYSCTL=true
|
ARG VPP_INSTALL_SKIP_SYSCTL=true
|
||||||
ARG REPO=release
|
ARG REPO=release
|
||||||
@ -8,25 +8,23 @@ RUN apt-get update && apt-get -y install curl procps tcpdump iproute2 iptables \
|
|||||||
mtr-tiny traceroute && apt-get clean
|
mtr-tiny traceroute && apt-get clean
|
||||||
|
|
||||||
# Install VPP
|
# Install VPP
|
||||||
RUN mkdir -p /var/log/vpp /root/.ssh/
|
RUN mkdir -p /var/log/vpp /root/.ssh/ && \
|
||||||
RUN curl -s https://packagecloud.io/install/repositories/fdio/${REPO}/script.deb.sh | bash
|
curl -s https://packagecloud.io/install/repositories/fdio/${REPO}/script.deb.sh | bash && \
|
||||||
RUN apt-get update && apt-get -y install vpp vpp-plugin-core && apt-get clean
|
apt-get -y install vpp vpp-plugin-core && apt-get clean
|
||||||
|
|
||||||
# Build vppcfg
|
# Build vppcfg
|
||||||
RUN pip install --break-system-packages build netaddr yamale argparse pyyaml ipaddress
|
RUN pip install --break-system-packages build netaddr yamale argparse pyyaml ipaddress && \
|
||||||
RUN git clone https://git.ipng.ch/ipng/vppcfg.git && cd vppcfg && python3 -m build && \
|
git clone https://git.ipng.ch/ipng/vppcfg.git && cd vppcfg && python3 -m build && \
|
||||||
pip install --break-system-packages dist/vppcfg-*-py3-none-any.whl
|
pip install --break-system-packages dist/vppcfg-*-py3-none-any.whl
|
||||||
|
|
||||||
# Install FRR
|
# Install FRR
|
||||||
RUN curl -s -o /usr/share/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg && \
|
RUN curl -s -o /usr/share/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg && \
|
||||||
echo deb '[signed-by=/usr/share/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr bookworm frr-stable \
|
echo deb '[signed-by=/usr/share/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr bookworm frr-stable \
|
||||||
> /etc/apt/sources.list.d/frr.list && \
|
> /etc/apt/sources.list.d/frr.list && \
|
||||||
apt -y update && apt -y install frr frr-pythontools && apt clean
|
apt -y update && apt -y install frr frr-pythontools && apt clean
|
||||||
|
|
||||||
# Config files
|
# Config files
|
||||||
COPY files/etc/vpp/* /etc/vpp/
|
COPY files/etc/ /etc/
|
||||||
COPY files/etc/bird/* /etc/bird/
|
|
||||||
COPY files/etc/frr/* /etc/frr/
|
|
||||||
COPY files/init-container.sh /sbin/
|
COPY files/init-container.sh /sbin/
|
||||||
RUN chmod 755 /sbin/init-container.sh
|
RUN chmod 755 /sbin/init-container.sh
|
||||||
CMD ["/sbin/init-container.sh"]
|
CMD ["/sbin/init-container.sh"]
|
Reference in New Issue
Block a user