1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
Docker
======
This page covers how to build FRR Docker images.
Images
""""""
FRR has Docker build infrastructure to produce Docker images containing
source-built FRR on the following base platforms:
* Alpine
* Centos 7
* Centos 8
The following platform images are used to support Travis CI and can also
be used to reproduce topotest failures when the docker host is Ubuntu
(tested on 20.04 and 22.04):
* Ubuntu 20.04
* Ubuntu 22.04
The following platform images may also be built, but these simply install a
binary package from an existing repository and do not perform source builds:
* Debian 10
Some of these are available on `DockerHub
<https://hub.docker.com/repository/docker/frrouting/frr/tags?page=1>`_.
There is no guarantee on what is and is not available from DockerHub at time of
writing.
Scripts
"""""""
Some platforms contain an included build script that may be run from the host.
This will set appropriate packaging environment variables and clean up
intermediate build images.
These scripts serve another purpose. They allow building platform packages
without needing the platform. For example, the Centos 8 docker image can also
be leveraged to build Centos 8 RPMs that can then be used separately from
Docker.
If you are only interested in the Docker images and don't want the cleanup
functionality of the scripts you can ignore them and perform a normal Docker
build. If you want to build multi-arch docker images this is required as the
scripts do not support using Buildkit for multi-arch builds.
Building Alpine Image
---------------------
Script::
./docker/alpine/build.sh
No script::
docker build -f docker/alpine/Dockerfile .
No script, multi-arch (ex. amd64, arm64, armv7)::
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -f docker/alpine/Dockerfile -t frr:latest .
Building Debian Image
---------------------
::
cd docker/debian
docker build .
Multi-arch (ex. amd64, arm64, armv7)::
cd docker/debian
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t frr-debian:latest .
Building Centos 7 Image
-----------------------
Script::
./docker/centos-7/build.sh
No script::
docker build -f docker/centos-7/Dockerfile .
No script, multi-arch (ex. amd64, arm64)::
docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-7/Dockerfile -t frr-centos7:latest .
Building Centos 8 Image
-----------------------
Script::
./docker/centos-8/build.sh
No script::
docker build -f docker/centos-8/Dockerfile .
No script, multi-arch (ex. amd64, arm64)::
docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-8/Dockerfile -t frr-centos8:latest .
Building ubi 8 Image
-----------------------
Script::
./docker/ubi-8/build.sh
Script with params, an example could be this (all that info will go to docker label) ::
./docker/ubi-8/build.sh frr:ubi-8-my-test "$(git rev-parse --short=10 HEAD)" my_release my_name my_vendor
No script::
docker build -f docker/ubi-8/Dockerfile .
No script, multi-arch (ex. amd64, arm64)::
docker buildx build --platform linux/amd64,linux/arm64 -f docker/ubi-8/Dockerfile -t frr-ubi-8:latest .
Building Ubuntu 20.04 Image
---------------------------
Build image (from project root directory)::
docker build -t frr-ubuntu20:latest --build-arg=UBUNTU_VERSION=20.04 -f docker/ubuntu-ci/Dockerfile .
Running Full Topotest::
docker run --init -it --privileged --name frr-ubuntu20 -v /lib/modules:/lib/modules \
frr-ubuntu20:latest bash -c 'cd ~/frr/tests/topotests ; sudo pytest -nauto --dist=loadfile'
Extract results from the above run into `run-results` dir and analyze::
tests/topotests/analyze.py -C frr-ubuntu20 -Ar run-results
Start the container::
docker run -d --init --privileged --name frr-ubuntu20 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu20:latest
Running a topotest (when the docker host is Ubuntu)::
docker exec frr-ubuntu20 bash -c 'cd ~/frr/tests/topotests/ospf_topo1 ; sudo pytest test_ospf_topo1.py'
Starting an interactive bash session::
docker exec -it frr-ubuntu20 bash
Stopping an removing a container::
docker stop frr-ubuntu20 ; docker rm frr-ubuntu20
Removing the built image::
docker rmi frr-ubuntu20:latest
Building Ubuntu 22.04 Image
---------------------------
Build image (from project root directory)::
docker build -t frr-ubuntu22:latest -f docker/ubuntu-ci/Dockerfile .
Running Full Topotest::
docker run --init -it --privileged --name frr-ubuntu22 -v /lib/modules:/lib/modules \
frr-ubuntu22:latest bash -c 'cd ~/frr/tests/topotests ; sudo pytest -nauto --dist=loadfile'
Extract results from the above run into `run-results` dir and analyze::
tests/topotests/analyze.py -C frr-ubuntu22 -Ar run-results
Start the container::
docker run -d --init --privileged --name frr-ubuntu22 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu22:latest
Running a topotest (when the docker host is Ubuntu)::
docker exec frr-ubuntu22 bash -c 'cd ~/frr/tests/topotests/ospf_topo1 ; sudo pytest test_ospf_topo1.py'
Starting an interactive bash session::
docker exec -it frr-ubuntu22 bash
Stopping an removing a container::
docker stop frr-ubuntu22 ; docker rm frr-ubuntu22
Removing the built image::
docker rmi frr-ubuntu22:latest
|