diff --git a/nginx-jupyter/README.md b/nginx-jupyter/README.md index 08532a4..4faf1dd 100644 --- a/nginx-jupyter/README.md +++ b/nginx-jupyter/README.md @@ -11,15 +11,18 @@ If you haven't installed singularity, do that with [these instructions](http://s cd singularity-web -Let's now create a jupyter notebook! +Let's now create a jupyter notebook! Since we need a writable image, we issue the `--writable` to build: cd nginx-jupyter - sudo singularity create --size 4000 jupyter.img - sudo singularity bootstrap jupyter.img Singularity + sudo singularity build --writable jupyter.simg Singularity -Then to run our container, since we need to write files to `/opt/notebooks` inside the container, we must use sudo and add the `--writable` command: +and you could also build into a folder, if you want to easily browse files (this might be the best option for this use case) - sudo singularity run --writable jupyter.img + sudo singularity build --sandbox jupyter.simg Singularity + +Note that in the second option, the result is a folder and not a single image. Then to run our container, since we need to write files to `/opt/notebooks` inside the container, we must use sudo and add the `--writable` command: + + sudo singularity run --writable jupyter.simg When we open the browser, we see our server! Cool! @@ -27,17 +30,17 @@ When we open the browser, we see our server! Cool! Since the notebooks are being written to the image, this means that all of our work is preserved in it. I can finish working, close up shop, and hand my image to someone else, and it's preserved. Here, I'll show you. Let's shell into the container after we've shut down the server (note that I didn't need to use sudo for this). - sudo singularity shell jupyter.img + sudo singularity shell jupyter.simg Singularity: Invoking an interactive shell within container... - Singularity.jupyter.img> ls /opt/notebooks + Singularity.jupyter.simg> ls /opt/notebooks Untitled.ipynb There it is! I really should work on naming my files better :) That is so cool. You can also map to a folder on your local machine, if you don't want to save the notebooks inside: - sudo singularity run -B $PWD:/opt/notebooks --writable jupyter.img + sudo singularity run -B $PWD:/opt/notebooks --writable jupyter.simg and here I am sitting in my local directory, but the entire software and depdencies are provided by my container. STILL really cool.