Can we use environment variables to set client/server?
Opened this issue · 3 comments
Hi, I'm using this on a Synology NAS which is all GUI Docker manager so environment variables are the only way to affect a docker on startup. Is it possible to pass in an environment variable to specify server or client + ip? Thanks
Hi @brimur, apologies for the delay. You can definitely pass ENVs.
For example:
$ TARGET=192.168.1.120
$ sudo docker run -it --rm networkstatic/iperf3 -c $TARGET
Connecting to host 192.168.1.120, port 5201
[ 4] local 172.17.0.6 port 39726 connected to 192.168.1.120 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 1.93 GBytes 16.6 Gbits/sec 0 751 KBytes
[ 4] 1.00-2.00 sec 1.92 GBytes 16.5 Gbits/sec 0 1.40 MBytes
[ 4] 2.00-3.00 sec 2.03 GBytes 17.5 Gbits/sec 0 1.40 MBytes
Hi @nerdalert, thanks for the reply but what I meant was does it look for variables on startup of the container. The Synology implemention means I can only hit start, I can't actually go into the container and run iperf3, it's run when I start the container. So I was wondering if there was something like, on startup of the container it looks for the environment variable TYPE which can be server or client and if TYPE is client it looks for other variables such as SERVERIP and maybe others like PARALLEL. Np if not, was just curious.