Toastie 10 months ago
commit
7235889598
5 changed files with 77 additions and 0 deletions
  1. 31 0
      README.md
  2. 5 0
      build/Dockerfile-iperf2
  3. 5 0
      build/Dockerfile-iperf3
  4. 13 0
      docker-compose.override.yml
  5. 23 0
      docker-compose.yml

+ 31 - 0
README.md

@@ -0,0 +1,31 @@
+# iPerf Speed Test
+
+## Start Server
+
+
+```
+# Start a container for iperf2 (port 5001) and another for iperf3 (port 5201)
+# without a specific network as defined in docker-compose.override.yml
+docker-compose -f docker-compose.yml up --detach
+
+# Logs
+docker logs -f iperf2
+docker logs -f iperf3
+```
+
+## Run Client
+```
+docker-compose build             # build docker images locally
+iperf_server=iperf.example.com"  # set target server
+
+# Run iperf2
+docker run --rm toastie89/iperf2 sh -c "iperf -c $iperf_server"
+
+# Run iperf3
+docker run --rm toastie89/iperf3 sh -c "iperf3 -c $iperf_server"
+
+```
+
+
+## References
+  - https://iperf.fr/

+ 5 - 0
build/Dockerfile-iperf2

@@ -0,0 +1,5 @@
+FROM alpine
+RUN apk add --no-cache iperf
+EXPOSE 5001/tcp
+EXPOSE 5001/udp
+CMD ["/usr/bin/iperf","-s"]

+ 5 - 0
build/Dockerfile-iperf3

@@ -0,0 +1,5 @@
+FROM alpine
+RUN apk add --no-cache iperf3
+EXPOSE 5201/tcp
+EXPOSE 5201/udp
+CMD ["/usr/bin/iperf3","-s"]

+ 13 - 0
docker-compose.override.yml

@@ -0,0 +1,13 @@
+version: '3'
+services:
+  iperf2:
+    networks:
+      - docker-dmz
+  iperf3:
+    networks:
+      - docker-dmz
+networks:
+  docker-dmz:
+    external:
+      name: docker-dmz
+

+ 23 - 0
docker-compose.yml

@@ -0,0 +1,23 @@
+version: '3' 
+services:
+  iperf2:
+    build: 
+      context: ./build/
+      dockerfile: Dockerfile-iperf2
+    image: toastie89/iperf2
+    container_name: iperf2
+    hostname: iperf2 
+    restart: on-failure:3
+    ports:      
+      - '5001:5001'
+
+  iperf3:
+    build:
+      context: ./build/
+      dockerfile: Dockerfile-iperf3
+    image: toastie89/iperf3
+    container_name: iperf3
+    hostname: iperf3
+    restart: on-failure:3
+    ports:
+      - '5201:5201'