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