From d697ba67a272da760a12e843c7cba564da74c582 Mon Sep 17 00:00:00 2001 From: ycharbi Date: Tue, 3 Sep 2019 17:18:56 +0200 Subject: [PATCH] Ajout du conteneur frr. --- README.md | 2 ++ frr/Dockerfile | 12 ++++++++++++ frr/ENTRYPOINT.sh | 23 +++++++++++++++++++++++ frr/confint.sh | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 README.md create mode 100755 frr/Dockerfile create mode 100644 frr/ENTRYPOINT.sh create mode 100644 frr/confint.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e76d09 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Contenu du dépôt +Ce dépôt regroupe les conteneurs Docker que j'ai fait et pouvant servir à tout un chacun. diff --git a/frr/Dockerfile b/frr/Dockerfile new file mode 100755 index 0000000..39a2755 --- /dev/null +++ b/frr/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:buster-slim +ENV FRR_DAEMONS zebra bgpd ospfd ospf6d ripd ripngd isisd pimd ldpd nhrpd eigrpd babeld sharpd pbrd bfdd +COPY confint.sh /confint.sh +COPY ENTRYPOINT.sh /ENTRYPOINT.sh +RUN chmod +x /ENTRYPOINT.sh /confint.sh +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends frr frr-rpki-rtrlib iputils-ping busybox vim-tiny +RUN ln -s /usr/bin/vim.tiny /usr/bin/vim +ENTRYPOINT ["/ENTRYPOINT.sh"] + +# docker run -tid --cap-add=NET_ADMIN --cap-add=NET_RAW --cap-add=SYS_ADMIN --name frr-buster frr-buster +# https://github.com/iwaseyusuke/docker-frr +# https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities diff --git a/frr/ENTRYPOINT.sh b/frr/ENTRYPOINT.sh new file mode 100644 index 0000000..32c1f5f --- /dev/null +++ b/frr/ENTRYPOINT.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +for DAEMON in $FRR_DAEMONS +do + if [ -s "/usr/lib/frr/${DAEMON}" ] + then + touch /etc/frr/${DAEMON}.conf + sed -i "s/${DAEMON}=no/${DAEMON}=yes/" /etc/frr/daemons + else + echo "No such daemon: ${DAEMON}" + fi +done + +service frr restart > /dev/null 2>&1 + +if [ -f /confint.sh ] +then + /confint.sh +fi + +bash + +service frr stop > /dev/null 2>&1 diff --git a/frr/confint.sh b/frr/confint.sh new file mode 100644 index 0000000..b83265d --- /dev/null +++ b/frr/confint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Configuration des interfaces +