Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On a Mac laptop, it does not support docker run in network in host mode, the port mapping for TCP can must be explicitly defined in the script, such as:

docker run -it --rm -e EDGEVIEW_CLIENT=1 -h=$(hostname) -p 9001-9005:9001-9005 -v /tmp/download:/download lfedge/eve-edgeview -token <jwt-token> "$@"

Although in EdgeView multiple instances, a user may run two EdgeView sessions on the same laptop for instance 1 and instance 2. Using explicit range will collide for the ports on laptop. Here is a more the general script to set the part mapping range base on user's instance number input:

for var in "$@"
do
  if [ ! -z "$gotinst" ]; then
    instid=$var
    break
  fi
  if [ "$var" = "-inst" ]; then
    gotinst=1
  fi
done
portstart=9001
portend=9005
if [ ! -z "$instid" ]; then
  if [ "$instid" -lt 1 ] || [ "$instid" -gt 5 ]; then
    echo "inst needs to be in the range 1-5"
    exit
  fi
  newid=$(($instid - 1))
  multi=$(($newid * 5))
  portstart=$((9001 + $multi))
  portend=$((9005 + $multi))
fi
PORTMAP="-p $portstart-$portend:$portstart-$portend"
docker run -it --rm -e EDGEVIEW_CLIENT=1 -h=$(hostname) $PORTMAP -v /tmp/download:/download lfedge/eve-edgeview -token <jwt-token> "$@"


Window OS

For running the EdgeView client script, the Window OS needs to have docker desktop installed. The script works unchanged if the WSL version is 2.

...