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

123456789101112131415161718192021222324252627282930313233
  1. # ethloop - virtual RJ45 loopback plug
  2. FROM debian:buster-slim
  3. COPY ethloop.c /root/
  4. RUN set -e -x \
  5. && export DEBIAN_FRONTEND=noninteractive \
  6. && apt-get update \
  7. && apt-get -y --no-install-recommends install \
  8. libpcap0.8 net-tools \
  9. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/base_packages \
  10. && apt-get -y --no-install-recommends install \
  11. gcc libc6-dev libpcap0.8-dev \
  12. && gcc -Wall -O2 -s -o /usr/local/bin/ethloop /root/ethloop.c -lpcap \
  13. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/packages \
  14. && comm -13 /tmp/base_packages /tmp/packages | xargs apt-get -y purge \
  15. && rm -f /tmp/base_packages /tmp/packages \
  16. && rm -rf /var/lib/apt/lists/* \
  17. #
  18. # startup script
  19. #
  20. && printf '\
  21. \043!/bin/sh\n\
  22. \043 on eth0 disable IPv6, set MTU to 9000\n\
  23. ifconfig eth0 down\n\
  24. echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6\n\
  25. ifconfig eth0 mtu 9000 up\n\
  26. \n\
  27. exec ethloop eth0\n' \
  28. > /etc/init.sh && chmod +x /etc/init.sh
  29. CMD [ "/etc/init.sh" ]