GNS3 Docker Images
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # BIRD routing daemon, see http://bird.network.cz
  2. FROM debian:buster-slim
  3. RUN set -e -x \
  4. && export DEBIAN_FRONTEND=noninteractive \
  5. && apt-get update \
  6. #
  7. # download, compile and install bird v2
  8. #
  9. && apt-get -y --no-install-recommends install libreadline7 \
  10. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/base_packages \
  11. && apt-get -y --no-install-recommends install \
  12. curl gcc libc6-dev make bison flex libncurses-dev libreadline-dev \
  13. && latest=$(curl -s -S ftp://bird.network.cz/pub/bird/ | sed -n 's/^.*LATEST-IS-\(2.*\)/\1/p') \
  14. && if [ -z "$latest" ]; then echo "Latest BIRD package not found" >&2; exit 1; fi \
  15. && curl -s -S "ftp://bird.network.cz/pub/bird/bird-$latest.tar.gz" | tar xz \
  16. && cd bird* \
  17. && ./configure --sysconfdir='/etc/bird'\
  18. && make \
  19. && strip -s bird birdc birdcl \
  20. && make install \
  21. && cd .. \
  22. && rm -rf bird* \
  23. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/packages \
  24. && comm -13 /tmp/base_packages /tmp/packages | xargs apt-get -y purge \
  25. && rm -f /tmp/base_packages /tmp/packages \
  26. #
  27. # install remaining tools
  28. #
  29. && apt-get -y --no-install-recommends install \
  30. net-tools iproute2 ifupdown isc-dhcp-client inetutils-ping \
  31. telnet traceroute procps nano vim-tiny \
  32. && rm -rf /var/lib/apt/lists/* \
  33. #
  34. # setup BIRD
  35. #
  36. && printf '\
  37. \043!/bin/sh\n\
  38. \n\
  39. bird\n\
  40. cd /etc/bird\n\
  41. exec bash -i\n' \
  42. > /etc/init.sh && chmod +x /etc/init.sh \
  43. && printf '\
  44. \043!/usr/bin/awk -f\n\
  45. \n\
  46. BEGIN {\n\
  47. if (ARGC < 3 || ARGC > 4) {\n\
  48. print "Usage: create_routes <start IP> <count> [<output file>]"\n\
  49. exit 1\n\
  50. }\n\
  51. \n\
  52. split(ARGV[1], ip, ".")\n\
  53. ip[1] += 0; ip[2] += 0; ip[3] += 0; ip[4] += 0\n\
  54. cnt = ARGV[2]\n\
  55. out = "/dev/stdout"\n\
  56. if (ARGC > 3) out = ARGV[3]\n\
  57. \n\
  58. while (--cnt >= 0) {\n\
  59. print "route " ip[1] "." ip[2] "." ip[3] "." ip[4] "/32 unreachable;" > out\n\
  60. \n\
  61. for (i=4; i>0 && ++ip[i] >= 256; i--)\n\
  62. ip[i] = 0\n\
  63. }\n\
  64. }\n' \
  65. > /usr/local/bin/create_routes && chmod +x /usr/local/bin/create_routes
  66. VOLUME [ "/etc/bird" ]
  67. CMD [ "/etc/init.sh" ]