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.
 
 
 
 
 

69 lines
1.8 KiB

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