From 08b7278fb33235480e96af16ccfb4ab5ef6cd863 Mon Sep 17 00:00:00 2001 From: ajnouri Date: Thu, 20 Jul 2017 16:59:05 +0200 Subject: [PATCH] Add ab (apache benchmark) to webterm and update the description on gns3a file --- appliances/webterm.gns3a | 2 +- docker/webterm/Dockerfile | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 docker/webterm/Dockerfile diff --git a/appliances/webterm.gns3a b/appliances/webterm.gns3a index 44f84cc..de99927 100644 --- a/appliances/webterm.gns3a +++ b/appliances/webterm.gns3a @@ -1,7 +1,7 @@ { "name": "webterm", "category": "guest", - "description": "webterm is a debian based networking toolbox.\nIt contains the firefox web browser plus the following utilities: net-tools, iproute2, ping, traceroute, curl, host, iperf3, mtr, socat, ssh client, tcpdump and the multicast testing tools msend/mreceive.", + "description": "webterm is a debian based networking toolbox.\nIt contains the firefox web browser plus the following utilities: net-tools, iproute2, ping, traceroute, curl, host, iperf3, mtr, socat, ssh client, tcpdump, ab(apache benchmark) and the multicast testing tools msend/mreceive.", "vendor_name": "webterm", "vendor_url": "https://www.debian.org", "product_name": "webterm", diff --git a/docker/webterm/Dockerfile b/docker/webterm/Dockerfile new file mode 100644 index 0000000..badab90 --- /dev/null +++ b/docker/webterm/Dockerfile @@ -0,0 +1,60 @@ +# docker image with basic networking tools and web browser + +FROM gns3/ipterm-base + +# minimal init, see https://github.com/Yelp/dumb-init +ADD https://github.com/Yelp/dumb-init/releases/download/v1.1.1/dumb-init_1.1.1_amd64 /usr/local/sbin/dumb-init + +RUN set -ex \ + && chmod 755 /usr/local/sbin/dumb-init \ + && apt-get update \ +# +# install web tools +# + && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + firefox-esr lxterminal jwm menu leafpad apache2-utils \ + && rm -rf /var/lib/apt/lists/* \ + && /bin/echo -e '\ +\x23!/bin/sh\n\ +\n\ +\x23 use home page on first start\n\ +[ -e "$HOME/.mozilla" ] || start_url="about:home"\n\ +\n\ +\x23 start firefox\n\ +start=$(date +%s)\n\ +firefox $start_url\n\ +status=$?\n\ +\n\ +\x23 workaround: restart firefox, if it crashes during initialization\n\ +if [ $status -eq 139 -a $(($(date +%s)-start)) -le 10 ]; then\n\ + firefox $start_url\n\ +fi' \ + > /usr/local/bin/start-firefox && chmod +x /usr/local/bin/start-firefox \ + && /bin/echo -e '\ +?package(firefox-esr):\\\n\ + needs="x11"\\\n\ + section="Applications"\\\n\ + title="Mozilla Firefox"\\\n\ + command="start-firefox"' \ + > /etc/menu/firefox \ + && echo "postrun="\""sed -i '/^ > /etc/menu-methods/jwm \ + && sed -i 's/\(Desktops width\)="[0-9]*"/\1="2"/' /etc/jwm/system.jwmrc \ + && update-menus \ + && mkdir -p /root/.config/lxterminal \ + && /bin/echo -e '\ +[general]\n\ +scrollback=1000\n\ +fgcolor=#ffffff' \ + > /root/.config/lxterminal/lxterminal.conf \ + && /bin/echo -e '\ +\x23!/bin/sh\n\ +[ $$ -eq 1 ] && exec dumb-init "$0" "$@"\n\ +\n\ +cd\n\ +export SHELL=/bin/bash\n\ +start-firefox &\n\ +jwm' \ + > /etc/init.sh && chmod +x /etc/init.sh + +VOLUME [ "/root" ] +CMD [ "/etc/init.sh" ]