1Docker 2====== 3 4This page covers how to build FRR Docker images. 5 6Images 7"""""" 8FRR has Docker build infrastructure to produce Docker images containing 9source-built FRR on the following base platforms: 10 11* Alpine 12* Centos 7 13* Centos 8 14 15The following platform images may also be built, but these simply install a 16binary package from an existing repository and do not perform source builds: 17 18* Debian 10 19 20Some of these are available on `DockerHub 21<https://hub.docker.com/repository/docker/frrouting/frr/tags?page=1>`_. 22 23There is no guarantee on what is and is not available from DockerHub at time of 24writing. 25 26Scripts 27""""""" 28 29Some platforms contain an included build script that may be run from the host. 30This will set appropriate packaging environment variables and clean up 31intermediate build images. 32 33These scripts serve another purpose. They allow building platform packages 34without needing the platform. For example, the Centos 8 docker image can also 35be leveraged to build Centos 8 RPMs that can then be used separately from 36Docker. 37 38If you are only interested in the Docker images and don't want the cleanup 39functionality of the scripts you can ignore them and perform a normal Docker 40build. If you want to build multi-arch docker images this is required as the 41scripts do not support using Buildkit for multi-arch builds. 42 43Building Alpine Image 44--------------------- 45 46Script:: 47 48 ./docker/alpine/build.sh 49 50No script:: 51 52 docker build -f docker/alpine/Dockerfile . 53 54No script, multi-arch (ex. amd64, arm64, armv7):: 55 56 docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -f docker/alpine/Dockerfile -t frr:latest . 57 58 59Building Debian Image 60--------------------- 61 62:: 63 64 cd docker/debian 65 docker build . 66 67Multi-arch (ex. amd64, arm64, armv7):: 68 69 cd docker/debian 70 docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t frr-debian:latest . 71 72Building Centos 7 Image 73----------------------- 74 75Script:: 76 77 ./docker/centos-7/build.sh 78 79No script:: 80 81 docker build -f docker/centos-7/Dockerfile . 82 83No script, multi-arch (ex. amd64, arm64):: 84 85 docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-7/Dockerfile -t frr-centos7:latest . 86 87 88Building Centos 8 Image 89----------------------- 90 91Script:: 92 93 ./docker/centos-8/build.sh 94 95No script:: 96 97 docker build -f docker/centos-8/Dockerfile . 98 99No script, multi-arch (ex. amd64, arm64):: 100 101 docker buildx build --platform linux/amd64,linux/arm64 -f docker/centos-8/Dockerfile -t frr-centos8:latest . 102