]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-alpine.rst
bgpd: l3vni add-del handle non-defualt rt
[mirror_frr.git] / doc / developer / building-frr-for-alpine.rst
1 Alpine Linux 3.7+
2 =========================================================
3
4 For building Alpine Linux dev packages, we use docker.
5
6 Install docker 17.05 or later
7 -----------------------------
8
9 Depending on your host, there are different ways of installing docker. Refer
10 to the documentation here for instructions on how to install a free version of
11 docker: https://www.docker.com/community-edition
12
13 Pre-built packages and docker images
14 ------------------------------------
15
16 The master branch of https://github.com/frrouting/frr.git has a
17 continuous delivery of docker images to docker hub at:
18 https://hub.docker.com/r/ajones17/frr/. These images have the frr packages
19 in /pkgs/apk and have the frr package pre-installed. To copy Alpine
20 packages out of these images:
21
22 ::
23
24 id=`docker create ajones17/frr:latest`
25 docker cp ${id}:/pkgs _some_directory_
26 docker rm $id
27
28 To run the frr daemons (see below for how to configure them):
29
30 ::
31
32 docker run -it --rm --name frr ajones17/frr:latest
33 docker exec -it frr /bin/sh
34
35 Work with sources
36 -----------------
37
38 ::
39
40 git clone https://github.com/frrouting/frr.git frr
41 cd frr
42
43 Build apk packages
44 ------------------
45
46 ::
47
48 ./docker/alpine/build.sh
49
50 This will put the apk packages in:
51
52 ::
53
54 ./docker/pkgs/apk/x86_64/
55
56 Usage
57 -----
58
59 To create a base image with the frr packages installed:
60
61 ::
62
63 docker build --rm -f docker/alpine/Dockerfile -t frr:latest .
64
65 Or, if you don't have a git checkout of the sources, you can build a base
66 image directly off the github account:
67
68 ::
69
70 docker build --rm -f docker/alpine/Dockerfile -t frr:latest \
71 https://github.com/frrouting/frr.git
72
73 And to run the image:
74
75 ::
76
77 docker run -it --rm --name frr frr:latest
78
79 In the default configuration, none of the frr daemons will be running.
80 To configure the daemons, exec into the container and edit the configuration
81 files or mount a volume with configuration files into the container on
82 startup. To configure by hand:
83
84 ::
85
86 docker exec -it frr /bin/sh
87 vi /etc/frr/daemons
88 vi /etc/frr/daemons.conf
89 cp /etc/frr/zebra.conf.sample /etc/frr/zebra.conf
90 vi /etc/frr/zebra.conf
91 /etc/init.d/frr start
92
93 Or, to configure the daemons using /etc/frr from a host volume, put the
94 config files in, say, ./docker/etc and bind mount that into the
95 container:
96
97 ::
98
99 docker run -it --rm -v `pwd`/docker/etc:/etc/frr frr:latest
100
101 We can also build the base image directly from docker-compose, with a
102 docker-compose.yml file like this one:
103
104 ::
105
106 version: '2.2'
107
108 services:
109 frr:
110 build:
111 context: https://github.com/frrouting/frr.git
112 dockerfile: docker/alpine/Dockerfile