echo "DELAY=${DELAY}";
echo "RATE=${RATE}";
echo "DOCKER_NETWORK=${DOCKER_NETWORK}";
echo "PROXY_SOURCE=$PROXY_SOURCE";

docker run -d --name $1 \
       -e DELAY=$DELAY \
       -e RATE=$RATE \
       -e ETH1DELAY=$ETH1DELAY \
       -e ETH1RATE=$ETH1RATE \
       -e PROXY_SOURCE=$PROXY_SOURCE \
       --network=${DOCKER_NETWORK} \
       -v ${IPFS_ABR_BASE}/caddy:/caddy \
       -v ${REPO}:/ipfs-mount \
       --cap-add=NET_ADMIN \
       hare1039/mpeg-dash-ipfs:$2

if [[ "${SECOND_DOCKER_NETWORK}" != "" ]]; then
    echo "SECOND_DOCKER_NETWORK=${SECOND_DOCKER_NETWORK}";
    sleep 2;
    docker network connect ${SECOND_DOCKER_NETWORK} $1;
fi
