Home > front end >  Modifying Docker Entry Point Script to Launch Jupyter lab
Modifying Docker Entry Point Script to Launch Jupyter lab

Time:10-21

I'm having trouble modifying a Docker entry point script to launch Jupyter Lab. I'm not familiar with bash language and it hangs in error at modification. Thank you for help.

Here are the source files:
https://github.com/dusty-nv/jetson-containers/blob/eb2307d40f0884d66310e9ac34633a4c5ef2e083/Dockerfile.ml#L154 https://github.com/dusty-nv/jetson-containers/blob/master/packages/ros_entrypoint.sh

Here is the code:

#!/bin/bash  
set -e

ros_env_setup="/opt/ros/$ROS_DISTRO/setup.bash"  
echo "sourcing $ros_env_setup"  
source "$ros_env_setup"

echo "ROS_ROOT $ROS_ROOT"
echo "ROS_DISTRO $ROS_DISRO"

Modification start:      

do
    jupyter lab --ip 0.0.0.0 --port 8888 --allow-root &> /var/log/jupyter.log
    echo "allow 10 sec for Jupyterlab to start @ http://$(hostname -I | cut -d' ' -f1):8888"
    echo "JupyterLab logging location: /var/log/jupyter.log (inside the container)"
done

Modification end

exec "$@"

CodePudding user response:

I assume that the reason is that jupyter command is blocking. You can put that process to the background by adding & at the end of the command.

jupyter lab --ip 0.0.0.0 --port 8888 --allow-root &> /var/log/jupyter.log &
  • Related