Skip to content
Snippets Groups Projects
Commit 73a4923a authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch 'master' of git.km3net.de:common/dockerfiles

parents e769a5c6 cdb46249
No related branches found
No related tags found
No related merge requests found
......@@ -14,3 +14,8 @@ needs to download a few GB of data, but consecutive runs will be faster:
To access the JupterLab instance, click on the link shown in the terminal --
and leave that terminal open!
If you want to work with Jpp/aanet/km3pipe in the terminal inside Jupyter,
create a new terminal window, ignore the error message and simply launch
Bash by typing `bash`. You will have a fully working terminal session with
all the software activated.
\ No newline at end of file
......@@ -4,6 +4,8 @@ NOTEBOOK_DIR=$HOME/notebooks
USER_ID=$(id -u)
THE_USER=$USER
mkdir -p $NOTEBOOK_DIR
cat << EOF > kernel.json
{
"argv": [
......@@ -34,7 +36,9 @@ cat << EOF > Dockerfile
FROM docker.km3net.de/km3book:1.0.0
RUN useradd -d $NOTEBOOK_DIR -u $(id -u) -s /bin/bash $USER
RUN apt-get install -qq -y vim
RUN rm -f /usr/local/share/jupyter/kernels/python3/kernel.json
ADD kernel.json /usr/local/share/jupyter/kernels/python3/kernel.json
RUN chown $USER /usr/local/share/jupyter/kernels/python3/kernel.json
USER $USER
CMD jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --notebook-dir=$NOTEBOOK_DIR
......@@ -42,6 +46,25 @@ CMD jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --notebook-dir=$NOTEBOOK_D
EXPOSE 22
EOF
sudo docker build -t km3book:1.0.0 -f Dockerfile .
sudo docker build -t mykm3book -f Dockerfile .
chown -R $THE_USER $NOTEBOOK_DIR
sudo docker run -p 8000:8888 -p 2200:22 -u $USER_ID -v $NOTEBOOK_DIR:$NOTEBOOK_DIR -it km3book:1.0.0
cat << EOF > run.sh
#!/bin/bash
sudo docker run -p 8888:8888 -p 2200:22 -u $USER_ID -v $NOTEBOOK_DIR:$NOTEBOOK_DIR -it mykm3book
EOF
echo
echo
echo The run script has been generated. From now on, please execute
echo
echo " ./run.sh"
echo
echo "to launch the JupyterLab instance. I'll do it for you in 5 seconds!"
echo
echo
sleep 5
chmod +x run.sh
./run.sh
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment