diff --git a/Dockerfile b/Dockerfile index 2769ab91f596b8c7bf209e082f6fc6a7a16c8de8..734a8fd3f4b6493246f1c7e522da2934d09e849b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,7 @@ ARG UNAME ARG UID ARG PASSWD ARG JUPYTER_PORT +ARG NETRON_PORT RUN groupadd -g $GID $GNAME RUN useradd -M -u $UID $UNAME -g $GNAME @@ -45,4 +46,5 @@ USER $UNAME RUN echo "source \$VIVADO_PATH/settings64.sh" >> /home/$UNAME/.bashrc RUN echo "PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '" >> /home/$UNAME/.bashrc EXPOSE $JUPYTER_PORT +EXPOSE $NETRON_PORT WORKDIR /home/$UNAME/finn diff --git a/run-docker.sh b/run-docker.sh index 0cbdff79b117417e65fb7a8998ba199d08d0501e..d774f0871d7b52e1015f4817a0e8aa49bef5a427 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -16,6 +16,7 @@ DOCKER_RND=$(shuf -i0-32768 -n1) DOCKER_TAG="finn_${DOCKER_UNAME}" DOCKER_INST_NAME="finn_${DOCKER_UNAME}_${DOCKER_RND}" : ${JUPYTER_PORT=8888} +: ${NETRON_PORT=8081} # Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=$(readlink -f "$0") @@ -60,6 +61,7 @@ echo "Mounting $SCRIPTPATH/PYNQ-HelloWorld into /workspace/PYNQ-HelloWorld" echo "Mounting $BUILD_LOCAL into $BUILD_LOCAL" echo "Mounting $VIVADO_PATH into $VIVADO_PATH" echo "Port-forwarding for Jupyter $JUPYTER_PORT:$JUPYTER_PORT" +echo "Port-forwarding for Netron $NETRON_PORT:$NETRON_PORT" if [ "$1" = "test" ]; then echo "Running test suite" @@ -80,6 +82,7 @@ docker build --tag=$DOCKER_TAG \ --build-arg UID=$DOCKER_UID \ --build-arg PASSWD=$DOCKER_PASSWD \ --build-arg JUPYTER_PORT=$JUPYTER_PORT \ + --build-arg NETRON_PORT=$NETRON_PORT \ . # Launch container with current directory mounted docker run -t --rm --name $DOCKER_INST_NAME -it \ @@ -99,4 +102,5 @@ docker run -t --rm --name $DOCKER_INST_NAME -it \ -e FINN_INST_NAME=$DOCKER_INST_NAME \ -e FINN_ROOT="/workspace/finn" \ -p $JUPYTER_PORT:$JUPYTER_PORT \ +-p $NETRON_PORT:$NETRON_PORT \ $DOCKER_TAG bash -c "$DOCKER_CMD"