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.

43 lines
1008B

  1. # Open vSwitch
  2. FROM alpine
  3. ADD ovs_init.sh /etc/
  4. RUN set -e -x -o pipefail \
  5. #
  6. # install openvswitch and dumb-init, nano, nodnsd
  7. #
  8. && apk --no-cache add dumb-init nano \
  9. openvswitch openvswitch-doc mdocml less \
  10. && mkdir -p /usr/local/sbin \
  11. && wget -q -O /usr/local/sbin/nodnsd https://git.bernhard-ehlers.de/ehlers/nodnsd/releases/download/v0.1/nodnsd_linux_amd64.bin \
  12. && chmod 755 /usr/local/sbin/nodnsd \
  13. && printf '\
  14. export PATH="$PATH:/usr/share/openvswitch/scripts"\n\
  15. export LESS="-M -i"\n\
  16. export PAGER="less -s"\n' \
  17. >> /root/.profile \
  18. #
  19. # startup script
  20. #
  21. && chmod +x /etc/ovs_init.sh \
  22. && printf '\
  23. \043!/bin/sh\n\
  24. [ $$ -eq 1 ] && exec dumb-init -r 15:1 -- "$0" "$@"\n\
  25. \n\
  26. nodnsd\n\
  27. \n\
  28. /etc/ovs_init.sh\n\
  29. \n\
  30. [ -r /root/.profile ] && . /root/.profile\n\
  31. if [ $# -gt 0 ]; then\n\
  32. exec "$@"\n\
  33. else\n\
  34. cd; exec ash -i\n\
  35. fi\n' \
  36. > /etc/init.sh && chmod +x /etc/init.sh
  37. ENTRYPOINT [ "/etc/init.sh" ]
  38. VOLUME [ "/root", "/etc/openvswitch" ]