frr/doc/developer/building-frr-on-alpine.rst
Arthur Jones 19e622d51e alpine packaging: build packages and base image directly from git
Currently, we tar up the git repo before building alpine packages.
This ensures that the packages we're building are exactly what is
checked in.  But, in practice, this restriction causes us to not
be able to build off of git contexts, which is a convenient feature
especially when using docker-compose.

So, here, we build the alpine packages directly from the contents
of the current directory and we install the packages into a base
image to ease downstream consumption.  There is still work to be
done in that area, as we need to package up the daemons, frr user
and all the rest, but that's for later...

Testing-done:

Built directly from the git repo, built from a reference to the
git repo and built using docker-compose, all seemed to work.  Also,
tested by @leleobhz and seems to build fine.

Thanks to Leonardo Amaral (@leleobhz) for reporting the issue and for
the original idea for a fix.

Issue: https://github.com/FRRouting/frr/issues/2024
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-04-04 10:05:44 -07:00

72 lines
1.5 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 frr:latest /bin/sh
Currently, we only package the raw daemons and example files, so, you'll
need to run the daemons by hand (or, better, orchestrate in the Dockerfile).
We can also build 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