4 This page covers how to build FRR Docker images.
8 FRR has Docker build infrastructure to produce Docker images containing
9 source-built FRR on the following base platforms:
15 The following platform images are used to support Travis CI and can also
16 be used to reproduce topotest failures when the docker host is Ubuntu
17 (tested on 18.04 and 20.04):
22 The following platform images may also be built, but these simply install a
23 binary package from an existing repository and do not perform source builds:
27 Some of these are available on `DockerHub
28 <https://hub.docker.com/repository/docker/frrouting/frr/tags?page=1>`_.
30 There is no guarantee on what is and is not available from DockerHub at time of
36 Some platforms contain an included build script that may be run from the host.
37 This will set appropriate packaging environment variables and clean up
38 intermediate build images.
40 These scripts serve another purpose. They allow building platform packages
41 without needing the platform. For example, the Centos 8 docker image can also
42 be leveraged to build Centos 8 RPMs that can then be used separately from
45 If you are only interested in the Docker images and don't want the cleanup
46 functionality of the scripts you can ignore them and perform a normal Docker
47 build. If you want to build multi-arch docker images this is required as the
48 scripts do not support using Buildkit for multi-arch builds.
55 ./docker/alpine/build.sh
59 docker build -f docker/alpine/Dockerfile .
61 No script, multi-arch (ex. amd64, arm64, armv7)::
63 docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -f docker/alpine/Dockerfile -t frr:latest .
74 Multi-arch (ex. amd64, arm64, armv7)::
77 docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t frr-debian:latest .
79 Building Centos 7 Image
80 -----------------------
84 ./docker/centos-7/build.sh
88 docker build -f docker/centos-7/Dockerfile .
90 No script, multi-arch (ex. amd64, arm64)::
92 docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-7/Dockerfile -t frr-centos7:latest .
95 Building Centos 8 Image
96 -----------------------
100 ./docker/centos-8/build.sh
104 docker build -f docker/centos-8/Dockerfile .
106 No script, multi-arch (ex. amd64, arm64)::
108 docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-8/Dockerfile -t frr-centos8:latest .
112 Building Ubuntu 18.04 Image
113 ---------------------------
115 Build image (from project root directory)::
117 docker build -t frr-ubuntu18:latest -f docker/ubuntu18-ci/Dockerfile .
119 Start the container::
121 docker run -d --privileged --name frr-ubuntu18 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu18:latest
123 Running a topotest (when the docker host is Ubuntu)::
125 docker exec frr-ubuntu18 bash -c 'cd ~/frr/tests/topotests/ospf-topo1 ; sudo pytest test_ospf_topo1.py'
127 Starting an interactive bash session::
129 docker exec -it frr-ubuntu18 bash
131 Stopping an removing a container::
133 docker stop frr-ubuntu18 ; docker rm frr-ubuntu18
135 Removing the built image::
137 docker rmi frr-ubuntu18:latest
140 Building Ubuntu 20.04 Image
141 ---------------------------
143 Build image (from project root directory)::
145 docker build -t frr-ubuntu20:latest -f docker/ubuntu20-ci/Dockerfile .
147 Start the container::
149 docker run -d --privileged --name frr-ubuntu20 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu20:latest
151 Running a topotest (when the docker host is Ubuntu)::
153 docker exec frr-ubuntu20 bash -c 'cd ~/frr/tests/topotests/ospf-topo1 ; sudo pytest test_ospf_topo1.py'
155 Starting an interactive bash session::
157 docker exec -it frr-ubuntu20 bash
159 Stopping an removing a container::
161 docker stop frr-ubuntu20 ; docker rm frr-ubuntu20
163 Removing the built image::
165 docker rmi frr-ubuntu20:latest