{"id":27352626,"url":"https://github.com/augusto-herrmann/docker-jupyter-extensible","last_synced_at":"2025-04-12T20:59:42.109Z","repository":{"id":47206864,"uuid":"293896722","full_name":"augusto-herrmann/docker-jupyter-extensible","owner":"augusto-herrmann","description":"A docker image for using Jupyter Notebook and Jupyter Lab, making it easy for you to extend it with the packages you need.","archived":false,"fork":false,"pushed_at":"2023-01-18T18:10:10.000Z","size":10,"stargazers_count":24,"open_issues_count":0,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T20:59:37.865Z","etag":null,"topics":["docker","jupyter-lab","jupyter-notebook"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/augusto-herrmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-08T18:37:16.000Z","updated_at":"2025-01-23T12:46:50.000Z","dependencies_parsed_at":"2023-02-10T16:30:27.188Z","dependency_job_id":null,"html_url":"https://github.com/augusto-herrmann/docker-jupyter-extensible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augusto-herrmann%2Fdocker-jupyter-extensible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augusto-herrmann%2Fdocker-jupyter-extensible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augusto-herrmann%2Fdocker-jupyter-extensible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augusto-herrmann%2Fdocker-jupyter-extensible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/augusto-herrmann","download_url":"https://codeload.github.com/augusto-herrmann/docker-jupyter-extensible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631699,"owners_count":21136561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","jupyter-lab","jupyter-notebook"],"created_at":"2025-04-12T20:59:41.603Z","updated_at":"2025-04-12T20:59:42.091Z","avatar_url":"https://github.com/augusto-herrmann.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Extensible Docker image for Jupyter Notebook/Lab\n\nMost tutorials for using Jupyter Notebook or Jupyter Lab end when you get\nJupyter running. But, in real world applications, you will also want to\nset up your own system configuration parameters, install your own system and\nPython packages, and it may not be obvious how to do it.\n\nThis repository intends to show you an example of a Docker file where you\ncan configure the packages you want and then build your own Docker image.\nHere we are going to use `jupyter/scipy-notebook` as a base image, but you can\neasily change that by editing the `Dockerfile`. The system configuration and\npackages installed are also intended as examples for you to edit.\n\n## Getting started\n\n1. Install Docker.\n\n2. Edit the `Dockerfile` and choose a base image. The default is:\n\n   ```dockerfile\n   FROM jupyter/scipy-notebook\n   ```\n\n   which includes [Pandas](https://pandas.pydata.org/),\n   [NumPy](https://numpy.org/) and a few other things. To find a Docker image\n   that best suits your needs, take a look at the\n   [Jupyter Docker Stacks documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html).\n\n3. At the following section of the `Dockerfile`, choose the system\n   configuration you want to do. In this example, we configure the system\n   locales to use both `en_US.UTF-8` (English, US) and `pt_BR.UTF-8`\n   (Brazilian Portuguese) locales.\n   \n   ```dockerfile\n   # install the locales you want to use\n   RUN set -ex \\\n      \u0026\u0026 sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \\\n      \u0026\u0026 sed -i 's/^# pt_BR.UTF-8 UTF-8$/pt_BR.UTF-8 UTF-8/g' /etc/locale.gen \\\n      \u0026\u0026 locale-gen en_US.UTF-8 pt_BR.UTF-8 \\\n      \u0026\u0026 update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \\\n   ```\n\n4. At the following section of the `Dockerfile`, choose the Python packages\n   and\n   [Jupyter Lab extensions](https://jupyterlab.readthedocs.io/en/stable/user/extensions.html)\n   you need. For this example, we're using the data visualization tool\n   [Plotly](https://plotly.com/python/) and the map plotting package\n   [Folium](https://python-visualization.github.io/folium/).\n   \n   ```dockerfile\n   # install Python packages you often use\n   RUN set -ex \\\n      \u0026\u0026 conda install --quiet --yes \\\n      # choose the python packages you need\n      'plotly==5.12.0' \\\n      'folium==0.14.0' \\\n      \u0026\u0026 conda clean --all -f -y \\\n      # install jupyter lab extensions you need\n      \u0026\u0026 jupyter labextension install jupyterlab-plotly@5.12.0 --no-build \\\n      \u0026\u0026 jupyter lab build -y \\\n      \u0026\u0026 jupyter lab clean -y \\\n      \u0026\u0026 rm -rf \"/home/${NB_USER}/.cache/yarn\" \\\n      \u0026\u0026 rm -rf \"/home/${NB_USER}/.node-gyp\" \\\n      \u0026\u0026 fix-permissions \"${CONDA_DIR}\" \\\n      \u0026\u0026 fix-permissions \"/home/${NB_USER}\"\n   ```\n\n   Every time you want to install a new Python package, you must edit this file\n   again and also execute the next step.\n\n5. Build the Docker container with the following command:\n\n   ```bash\n   docker build --rm -t docker-jupyter-extensible .\n   ```\n\n   This should take a while to finish.\n\n6. Create a `.env` file so that the container can use the same user\n   permissions as your user:\n   \n   ```bash\n   printf \"UID=$(id -u)\\nGID=$(id -g)\\n\" \u003e .env\n   ```\n\n   This will allow you to use the `notebooks` folder both inside and\n   outside the container.\n\n7. Now you're set to go! Every time you want to start Jupyter, start from\n   this step.\n   \n   Run the container with\n      \n   ```bash\n   docker-compose up\n   ```\n\n   **Note:** After you have something important in the `notebooks` folder, I\n   highly recommend you back it up often. The container once for me deleted\n   the files in there automatically for some reason when I was trying to\n   figure out how to set up those containers. YOU HAVE BEEN WARNED. I'm in no\n   way responsible if you lose your files.\n\n8. Pay attention to the terminal and look for a link starting with\n   `http://127.0.0.1:8888` that also contains an access token. Open this\n   link on a browser to use Jupyter Notebook. If you want to use Jupyter Lab,\n   just change the URL afterwards to `http://127.0.0.1:8888/lab`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugusto-herrmann%2Fdocker-jupyter-extensible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugusto-herrmann%2Fdocker-jupyter-extensible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugusto-herrmann%2Fdocker-jupyter-extensible/lists"}