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

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