Move docker build stuff into a subdirectory. Update structure to retire manual-{pre,post}

This commit is contained in:
Pim van Pelt
2025-05-04 12:19:44 +02:00
parent f4f38646fd
commit 1667677f72
11 changed files with 21 additions and 14 deletions

View File

@ -2,24 +2,24 @@
This docker container creates a VPP instance based on the latest VPP release. It starts up as per
normal, using /etc/vpp/startup.conf (which Containerlab might replace when it starts its
containers). Once started, it'll execute /etc/vpp/bootstrap.vpp within the dataplane. There are
three relevant files:
containers). Once started, it'll execute `/etc/vpp/bootstrap.vpp` within the dataplane. There are
two relevant files:
1. `manual-pre.vpp` -- can be supplied by the user, to run any configuration statements before
containerlab takes control.
1. `clab.vpp` -- generated by `files/container-init.sh`. Its purpose is to bind the `veth`
1. `clab.vpp` -- generated by `files/init-container.sh`. Its purpose is to bind the `veth`
interfaces that containerlab has added to the container into the VPP dataplane (see below).
1. `vppcfg.vpp` -- generated by `files/init-container.sh`. Its purpose is to read the user
specified `vppcfg.yaml` file and convert it into VPP CLI commands. If no YAML file is
specified, or if it is not syntactically valid, an empty file is generated instead.
1. `manual-post.vpp` -- can be supplied by the user, to run any configuration statements after
containerlab is finished with its per-lab statements.
For Containerlab users who wish to have more control over their VPP bootstrap, it's possible to
bind-mount `/etc/vpp/bootstrap.vpp`.
## Building
```bash
IMG=git.ipng.ch/ipng/vpp-containerlab
TAG=latest
docker build --no-cache -f Dockerfile.bookworm -t $IMG .
docker build --no-cache -f docker/Dockerfile.bookworm -t $IMG docker/
docker image tag $IMG $IMG:$TAG
docker push $IMG
docker push $IMG:$TAG

View File

@ -0,0 +1,2 @@
exec /etc/vpp/clab.vpp
exec /etc/vpp/vppcfg.vpp

View File

@ -1,3 +1,6 @@
# This is the vpp-containerlab default startup.conf, which is meant to be
# overridden by Containerlab's node/fdio_vpp/vpp_startup_config.go.tpl
unix {
interactive
log /var/log/vpp/vpp.log

View File

@ -2,6 +2,7 @@
STARTUP_CONFIG=${STARTUP_CONFIG:="/etc/vpp/startup.conf"}
CLAB_VPP_FILE=${CLAB_VPP_FILE:=/etc/vpp/clab.vpp}
VPPCFG_VPP_FILE=${VPPCFG_VPP_FILE:=/etc/vpp/vppcfg.vpp}
NETNS=${NETNS:="dataplane"}
BIRD_ENABLED=${BIRD_ENABLED:="true"}
@ -40,5 +41,11 @@ set interface state $IFNAME up
EOF
done
echo "Generating $VPPCFG_VPP_FILE"
: > $VPPCFG_VPP_FILE
if [ -r /etc/vpp/vppcfg.yaml ]; then
vppcfg plan --novpp -c /etc/vpp/vppcfg.yaml -o $VPPCFG_VPP_FILE
fi
echo "Starting VPP"
exec /usr/bin/vpp -c $STARTUP_CONFIG

View File

@ -1,3 +0,0 @@
exec /etc/vpp/manual-pre.vpp
exec /etc/vpp/clab.vpp
exec /etc/vpp/manual-post.vpp

View File

@ -1 +0,0 @@
comment { These commands are executed after Containerlab stuff }

View File

@ -1 +0,0 @@
comment { These commands are executed before Containerlab stuff }