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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. FROM debian:buster-slim
  2. COPY do_auth.py tac_plus.conf.do_auth tac_passwd python*.deb /tmp/
  3. RUN set -e -x \
  4. #
  5. # install tacacs+ server
  6. #
  7. && export DEBIAN_FRONTEND=noninteractive \
  8. && apt-get update \
  9. && apt-get -y --no-install-recommends install \
  10. dumb-init /tmp/python*.deb tacacs+ \
  11. net-tools iproute2 ifupdown isc-dhcp-client inetutils-ping \
  12. telnet traceroute procps nano vim-tiny \
  13. && rm -rf /var/lib/apt/lists/* \
  14. #
  15. # update do_auth
  16. #
  17. && mv /tmp/do_auth.py /usr/sbin/do_auth \
  18. && chmod +x /usr/sbin/do_auth \
  19. #
  20. # tac_plus.conf template for do_auth
  21. #
  22. && mv /tmp/tac_plus.conf.do_auth /etc/tacacs+/ \
  23. #
  24. # tacacs utilities
  25. #
  26. && mv /tmp/tac_passwd /usr/local/sbin/ \
  27. && chmod 755 /usr/local/sbin/tac_passwd \
  28. && ln -s tac_passwd /usr/local/sbin/tac_adduser \
  29. && ln -s tac_passwd /usr/local/sbin/tac_deluser \
  30. && printf '\
  31. \043!/bin/sh\n\
  32. \n\
  33. tac_plus -C /etc/tacacs+/tac_plus.conf -P\n' \
  34. > /usr/local/sbin/tac_parse && chmod +x /usr/local/sbin/tac_parse \
  35. && printf '\
  36. \043!/bin/sh\n\
  37. \n\
  38. service tacacs_plus reload\n' \
  39. > /usr/local/sbin/tac_reload && chmod +x /usr/local/sbin/tac_reload \
  40. && printf '\
  41. \043!/bin/sh\n\
  42. \n\
  43. service tacacs_plus start\n' \
  44. > /usr/local/sbin/tac_start && chmod +x /usr/local/sbin/tac_start \
  45. && printf '\
  46. \043!/bin/sh\n\
  47. \n\
  48. service tacacs_plus stop\n' \
  49. > /usr/local/sbin/tac_stop && chmod +x /usr/local/sbin/tac_stop \
  50. && chown -h root:root /usr/local/sbin/* \
  51. #
  52. # startup script
  53. #
  54. && printf '\
  55. \043!/bin/sh\n\
  56. [ $$ -eq 1 ] && exec dumb-init -- "$0" "$@"\n\
  57. \n\
  58. service tacacs_plus start\n\
  59. \n\
  60. cd /etc/tacacs+\n\
  61. exec bash -i\n' \
  62. > /etc/init.sh && chmod +x /etc/init.sh
  63. VOLUME [ "/etc/tacacs+" ]
  64. CMD [ "/etc/init.sh" ]