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

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