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.
 
 
 
 
 

62 lines
1.4 KiB

  1. FROM debian:buster-slim
  2. RUN set -e -x \
  3. && export DEBIAN_FRONTEND=noninteractive \
  4. && apt-get update \
  5. && apt-get -y upgrade \
  6. && apt-get -y --no-install-recommends install \
  7. dumb-init rsyslog lnav \
  8. net-tools iproute2 ifupdown inetutils-ping \
  9. telnet traceroute procps nano vim-tiny \
  10. && rm -rf /var/lib/apt/lists/* \
  11. #
  12. # rsyslog configuration
  13. #
  14. && sed -i.orig -E -e '/imudp|imtcp/ s/^#//' -e '/^[^#].*klog/ s/^/#/' /etc/rsyslog.conf \
  15. && printf '\
  16. \043\n\
  17. \043 Logging from network devices\n\
  18. \043\n\
  19. if not ($fromhost-ip startswith "127.") then {\n\
  20. -/var/log/network\n\
  21. stop\n\
  22. }\n' \
  23. > /etc/rsyslog.d/40-network.conf \
  24. #
  25. # logview script
  26. #
  27. && printf '\
  28. \043!/bin/sh\n\
  29. \n\
  30. \043 skip options\n\
  31. while getopts ":hHI:iuCd:Vartw:c:f:nq" _; do :; done\n\
  32. \n\
  33. if [ $OPTIND -gt $# ]; then\n\
  34. \043 no arguments, view default logfiles\n\
  35. lnav "$@" /var/log/syslog /var/log/network\n\
  36. else\n\
  37. \043 logfiles in command line\n\
  38. lnav "$@"\n\
  39. fi\n' \
  40. > /usr/local/bin/logview && chmod +x /usr/local/bin/logview \
  41. #
  42. # startup script
  43. #
  44. && printf '\
  45. \043!/bin/sh\n\
  46. [ $$ -eq 1 ] && exec dumb-init -- "$0" "$@"\n\
  47. \n\
  48. service rsyslog start\n\
  49. [ -e /var/log/network ] || touch /var/log/network\n\
  50. \n\
  51. cd\n\
  52. logview\n\
  53. echo\n\
  54. echo "Use \"logview\" to view the logs."\n\
  55. echo\n\
  56. exec bash -i -l\n' \
  57. > /etc/init.sh && chmod +x /etc/init.sh
  58. VOLUME [ "/root", "/var/log" ]
  59. CMD [ "/etc/init.sh" ]