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 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # docker image for ostinato
  2. FROM debian:stretch-slim
  3. COPY ostinato*.deb python-ostinato*.tar.gz libpcap*.deb /tmp/
  4. RUN set -e -x \
  5. #
  6. # install ostinato
  7. #
  8. && export DEBIAN_FRONTEND=noninteractive \
  9. && echo 'wireshark-common wireshark-common/install-setuid boolean false' | debconf-set-selections \
  10. && apt-get update \
  11. && apt-get -y --no-install-recommends install \
  12. dumb-init /tmp/ostinato*.deb /tmp/libpcap*.deb wireshark tshark dillo lxterminal jwm menu leafpad \
  13. net-tools iproute2 ifupdown isc-dhcp-client inetutils-ping \
  14. telnet traceroute procps nano vim-tiny \
  15. && apt-get -y --no-install-recommends install \
  16. python python-pip python-setuptools python-wheel python-protobuf \
  17. && pip install --no-cache-dir /tmp/python-ostinato*.tar.gz \
  18. && rm -rf /var/lib/apt/lists/* \
  19. && ln -s /usr/bin/dillo /usr/local/bin/firefox \
  20. #
  21. # customize jwm menu
  22. #
  23. && printf '\
  24. ?package(ostinato):\\\n\
  25. needs="x11"\\\n\
  26. section="Applications"\\\n\
  27. title="Ostinato"\\\n\
  28. command="ostinato > /var/log/ostinato.log 2>&1"\n' \
  29. > /etc/menu/ostinato \
  30. && printf '\
  31. ?package(wireshark):\\\n\
  32. needs="x11"\\\n\
  33. section="Applications"\\\n\
  34. title="Wireshark"\\\n\
  35. command="wireshark"\n' \
  36. > /etc/menu/wireshark \
  37. && echo "postrun=\"sed -i '/^ </ d' debian-menu\"" >> /etc/menu-methods/jwm \
  38. && sed -i 's/\(Desktops width\)="[0-9]*"/\1="2"/' /etc/jwm/system.jwmrc \
  39. && sed -i 's/xterm/x-terminal-emulator/g' /etc/jwm/system.jwmrc \
  40. && update-menus \
  41. #
  42. # configure ostinato drone
  43. #
  44. && mkdir -p /root/.config/Ostinato \
  45. && printf '\
  46. [General]\n\
  47. RateAccuracy=Low\n\
  48. [PortList]\n\
  49. Include=eth*\n' \
  50. > /root/.config/Ostinato/drone.ini \
  51. #
  52. # configure wireshark
  53. #
  54. && sed -i 's/^disable_lua *=.*/disable_lua = true/' /etc/wireshark/init.lua \
  55. #
  56. # set lxterminal defaults
  57. #
  58. && mkdir -p /root/.config/lxterminal \
  59. && printf '\
  60. [general]\n\
  61. scrollback=1000\n\
  62. fgcolor=#ffffff\n' \
  63. > /root/.config/lxterminal/lxterminal.conf \
  64. #
  65. # startup script
  66. #
  67. && printf '\
  68. \043!/bin/sh\n\
  69. [ $$ -eq 1 ] && exec dumb-init -- "$0" "$@"\n\
  70. \n\
  71. \043 on unconfigured interfaces disable IPv6, set MTU to 9000\n\
  72. sed -n '\''s/^ *\\(eth[0-9]*\\):.*/\\1/p'\'' /proc/net/dev | sort > /tmp/netdev\n\
  73. sed -n '\''s/^iface *\\(eth[0-9]*\\).*/\\1/p'\'' /etc/network/interfaces | sort -u > /tmp/confdev\n\
  74. comm -13 /tmp/confdev /tmp/netdev | while read -r DEVICE; do\n\
  75. ip link set dev "$DEVICE" down\n\
  76. sysctl -q -w "net.ipv6.conf.${DEVICE}.disable_ipv6=1"\n\
  77. ip link set dev "$DEVICE" mtu 9000\n\
  78. ip link set dev "$DEVICE" up\n\
  79. done\n\
  80. rm /tmp/confdev /tmp/netdev\n\
  81. sleep 0.5\n\
  82. \n\
  83. \043 disable ostinato update, makes no sense in this environment\n\
  84. grep -q -w -F update.ostinato.org /etc/hosts || \\\n\
  85. printf "\\n# disable ostinato update\\n127.0.0.127\\tupdate.ostinato.org\\n" >> /etc/hosts\n\
  86. \n\
  87. \043 wireshark wants a /etc/machine-id\n\
  88. dd if=/dev/urandom bs=16 count=1 2>/dev/null | od -An -x | tr -d " " > /etc/machine-id\n\
  89. \n\
  90. \043 workaround: sometimes the first start of an X application fails\n\
  91. lxterminal -e true 2> /dev/null\n\
  92. \n\
  93. cd\n\
  94. export SHELL=/bin/bash\n\
  95. ostinato > /var/log/ostinato.log 2>&1 &\n\
  96. jwm\n' \
  97. > /etc/init.sh && chmod +x /etc/init.sh
  98. VOLUME [ "/root" ]
  99. CMD [ "/etc/init.sh" ]