mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-01 19:31:14 +00:00

Currently, we just package the frr daemons, but we don't run them. This is fine for basic tests, but it is inconvenient to orchestrate the daemons from downstream test environments. Here, we follow the redhat and debianpkg formats more closely, putting the daemons in /usr/lib/frr and including the frr user and groups in the package. We also include a docker specific startup script and a sysvinit link in /etc/init.d/frr for openrc based alpine installs. Testing done: Built packages, built base images, everything seems to work fine. Uninstalled the package, all the daemons stopped. Issue: https://github.com/FRRouting/frr/issues/2030 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
91 lines
2.0 KiB
ReStructuredText
91 lines
2.0 KiB
ReStructuredText
Alpine Linux 3.7+
|
|
=========================================================
|
|
|
|
For building Alpine Linux dev packages, we use docker.
|
|
|
|
Install docker 17.05 or later
|
|
-----------------------------
|
|
|
|
Depending on your host, there are different ways of installing docker. Refer
|
|
to the documentation here for instructions on how to install a free version of
|
|
docker: https://www.docker.com/community-edition
|
|
|
|
Work with sources
|
|
-----------------
|
|
|
|
::
|
|
|
|
git clone https://github.com/frrouting/frr.git frr
|
|
cd frr
|
|
|
|
Build apk packages
|
|
------------------
|
|
|
|
::
|
|
|
|
./docker/alpine/build.sh
|
|
|
|
This will put the apk packages in:
|
|
|
|
::
|
|
|
|
./docker/pkgs/apk/x86_64/
|
|
|
|
Usage
|
|
-----
|
|
|
|
To create a base image with the frr packages installed:
|
|
|
|
::
|
|
|
|
docker build --rm -f docker/alpine/Dockerfile -t frr:latest .
|
|
|
|
Or, if you don't have a git checkout of the sources, you can build a base
|
|
image directly off the github account:
|
|
|
|
::
|
|
|
|
docker build --rm -f docker/alpine/Dockerfile -t frr:latest \
|
|
https://github.com/frrouting/frr.git
|
|
|
|
And to run the image:
|
|
|
|
::
|
|
|
|
docker run -it --rm --name frr frr:latest
|
|
|
|
In the default configuration, none of the frr daemons will be running.
|
|
To configure the daemons, exec into the container and edit the configuration
|
|
files or mount a volume with configuration files into the container on
|
|
startup. To configure by hand:
|
|
|
|
::
|
|
|
|
docker exec -it frr /bin/sh
|
|
vi /etc/frr/daemons
|
|
vi /etc/frr/daemons.conf
|
|
cp /etc/frr/zebra.conf.sample /etc/frr/zebra.conf
|
|
vi /etc/frr/zebra.conf
|
|
/etc/init.d/frr start
|
|
|
|
Or, to configure the daemons using /etc/frr from a host volume, put the
|
|
config files in, say, ./docker/etc and bind mount that into the
|
|
container:
|
|
|
|
::
|
|
|
|
docker run -it --rm -v `pwd`/docker/etc:/etc/frr frr:latest
|
|
|
|
We can also build the base image directly from docker-compose, with a
|
|
docker-compose.yml file like this one:
|
|
|
|
::
|
|
|
|
version: '2.2'
|
|
|
|
services:
|
|
frr:
|
|
build:
|
|
context: https://github.com/frrouting/frr.git
|
|
dockerfile: docker/alpine/Dockerfile
|