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.
 
 
 
 
 

110 lines
3.2 KiB

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