]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-alpine.rst
Merge pull request #13464 from sri-mohan1/srib-ldpd
[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 /etc/init.d/frr start
89
90 Or, to configure the daemons using /etc/frr from a host volume, put the
91 config files in, say, ./docker/etc and bind mount that into the
92 container:
93
94 ::
95
96 docker run -it --rm -v `pwd`/docker/etc:/etc/frr frr:latest
97
98 We can also build the base image directly from docker-compose, with a
99 docker-compose.yml file like this one:
100
101 ::
102
103 version: '2.2'
104
105 services:
106 frr:
107 build:
108 context: https://github.com/frrouting/frr.git
109 dockerfile: docker/alpine/Dockerfile