mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-09 04:56:39 +00:00

Building alpine packages in a "standard" distro can be complicated due to the limited scope of the distro (embedded and small docker images). Building in a VM is one possibility, but docker support for alpine is very good (default docker images come in alpine due to the very small size). Here, we want to package up the current git repo into apk packages that can be easily installed in alpine linux using the apk tool. This support is not intended to package released versions of apk packages, that, if it comes to be, should be done here: git://git.alpinelinux.org/aports We're content here to build packages that can be used by developers to try out frr in docker and other alpine environments. This is a very minimal environment, we don't support importing keys (so, installing the packages with apk requires the --allow-untrusted option). In addition, we can't use the git commit id in hex as version tag, as alpine doesn't support hex digits in the version string. So, we need to convert the git hash to decimal before tagging the package with the extra version. This is yucky, but I can't think of another way to get a unique version per package. The alpine way (using a numeric date), only works for released packages, not for dev packages. Issue: https://github.com/FRRouting/frr/issues/1859 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
48 lines
1.2 KiB
ReStructuredText
48 lines
1.2 KiB
ReStructuredText
Building FRR dev packages on Alpine Linux from Git Source
|
|
=========================================================
|
|
|
|
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 add the packages to a docker image, create a Dockerfile in ./docker/pkgs:
|
|
|
|
FROM alpine:3.7
|
|
RUN mkdir -p /pkgs
|
|
ADD apk/ /pkgs/
|
|
RUN apk add --no-cache --allow-untrusted /pkgs/x86_64/*.apk
|
|
|
|
And build a docker image:
|
|
|
|
docker build --rm --force-rm -t alpine-dev-pkgs:latest docker/pkgs
|
|
|
|
And run the image:
|
|
|
|
docker run -it --rm alpine-dev-pkgs: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).
|