While Azure Notebooks might be the fastest and easiest way to do F# data science experiments on Jupyter notebooks, but that only works if you’re always online. What if you’re in a third world country (like me) and only have intermittent internet connectivity? How would you work with F# on Jupyter notebooks?
We have a solution for that. But of course, you need to go online first. After that, you can be offline all you want and still do work with the F# that you love in your favorite Jupyter notebook.
Docker to the rescue
Asciicast of the process
So how do we do this?
- First, the IfSharp repo is cloned.
- Then we go into the
- We then build the Docker image from the
docker build -t ifsharp:3.0.0-alpha .
- We then run the image using
docker run -d -v your_local_notebooks_dir:/notebooks -p your_port:8888 ifsharp:3.0.0-alpha. Change the port and the notebook location.
- After that, we use
docker psto see the running container. We copy the id if the running container.
- We open a bash shell inside the running container with
docker exec -it the-container-id /bin/bash. Replace `the-container-id` with the container ID we copied.
jupyter notebook listto see the running notebook. Copy the token after the
?token=part of the URL.
- Open the notebook in
localhostand paste the token to get access to the notebook.
After opening the notebook, we are met with this:
That is where we paste the token that we copied earlier. Paste it there on top and press
Congratulations! You can now create F# notebooks like this:
Now you can do your F# experiments on a Jupyter Notebook even when offline! Yey!