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

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # docker image with Ansible and basic networking tools
  2. FROM ehlers/ipterm-base
  3. RUN set -e -x \
  4. #
  5. # install ansible
  6. #
  7. && export DEBIAN_FRONTEND=noninteractive \
  8. && apt-get update \
  9. && apt-get -y --no-install-recommends install \
  10. ansible sshpass \
  11. #
  12. # install dependencies for junos network modules
  13. #
  14. && apt-get -y --no-install-recommends install \
  15. python3-ncclient python3-junos-eznc \
  16. && apt-get -y --no-install-recommends install \
  17. python3-pip python3-wheel \
  18. && pip3 install --no-cache-dir jxmlease \
  19. && apt-get autoremove -y --purge python3-pip python3-wheel \
  20. && rm -rf /var/lib/apt/lists/* \
  21. #
  22. # some ansible modules expect the python interpreter in /usr/bin/python
  23. #
  24. && ln -s python3 /usr/bin/python \
  25. #
  26. # startup script
  27. #
  28. && printf '\
  29. \043!/bin/sh\n\
  30. \n\
  31. \043 symlink /etc/hosts to persistent directory\n\
  32. mount | fgrep -q "on /etc/hosts "\n\
  33. if [ $? -ne 0 ]; then\n\
  34. [ -s /etc/ansible/etc_hosts ] || cp -p /etc/hosts /etc/ansible/etc_hosts\n\
  35. ln -sf /etc/ansible/etc_hosts /etc/hosts\n\
  36. fi\n\
  37. \n\
  38. cd; exec bash -i\n' \
  39. > /etc/init.sh && chmod +x /etc/init.sh
  40. VOLUME [ "/root", "/etc/ansible" ]
  41. CMD [ "/etc/init.sh" ]