Make JupyterLab run anywhere with docker

Move Jupyter quickly

docker run -d --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work -e GRANT_SUDO=yes --user root jupyter/datascience-notebook:$tag start-notebook.sh --NotebookApp.token=password

Make it move from anywhere.

run_jupyter_lab


#!/bin/bash
tag=latest
password=password
port=8888

# validate args
if [ $# -gt 1 ]; then
  echo ERROR: the number of args must be 0 or 1
  exit 1
fi

# if a port num is specified, then change the port num
if [ $# -ne 0 ]; then
  port=$1
fi

# the name of running container with port num
name=jl_${port}

# run juypyter lab with port $port
docker run -d --rm -p ${port}:8888 --name ${name} -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work -e GRANT_SUDO=yes --user root jupyter/datascience-notebook:$tag start-notebook.sh --NotebookApp.token=$password

Put this in something like ~ / bin / run_jupyter_lab. It is assumed that PATH is in here.

When you execute the run_jupyter_lab command, docker container will run with the name of the directory you executed. Run it in the directory where your notebook is.

reference

Make it work with VS Code

settings.json


{
    "python.pythonPath": "./.venv/bin/python3",
    "python.analysis.extraPaths": [
        "hoge/"
    ],
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000,
    "python.linting.lintOnSave": true,
    "python.linting.pylintEnabled": false,
    "python.linting.pycodestyleEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--ignore=W293, W504",
        "--max-line-length=200",
        "--max-complexity=20"
    ],
    "python.formatting.provider": "autopep8",
    "python.formatting.autopep8Args": [
        "--aggressive",
        "--aggressive"
    ],
    "autoDocstring.docstringFormat": "google",
    "editor.formatOnSave": true
}
pipenv --python 3.8
pipenv install --dev autopep8 flake8 

If you use jupyter

pipenv install --dev ipykernel

Library installation that seems necessary

pipenv install pandas scikit-learn matplotlib

Recommended Posts

Make JupyterLab run anywhere with docker
Run Pico with docker
Run Payara with Docker
Run TAO Core with Docker
Run Rails whenever with docker
Run SQL Server with Docker ToolBox
[docker] [nginx] Make a simple ALB with nginx
Run Ubuntu + ROS with Docker on Mac
How to run Blazor (C #) with Docker
Make SpringBoot1.5 + Gradle4.4 + Java8 + Docker environment compatible with Java11
Run JSP Hello World with Tomcat on Docker
Create jupyter notebook with Docker and run ruby
Make Volume faster when using Docker with vscode.
Run Scala with GraalVM & make it a native image
Launch MariaDB with Docker
Rails deploy with Docker
Explode Docker with WSL2
Run Android instrumentation unit tests with GitLab CI + Docker
Use Puphpeteer with Docker
Make Nuxt apps Docker
Operate Emby with Docker
Try WildFly with Docker
Use ngrok with Docker
[Docker] Connection with MySQL
Php settings with Docker
How to make Laravel faster with Docker for Mac
Run Mosquitto with Docker and try WebSocket communication with MQTT
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
Run phpunit on Docker
I tried to make an introduction to PHP + MySQL with Docker
Let's write how to make API with SpringBoot + Docker from 0
Make Docker confusing with Pokemon and make it easier to attach
Create Rails5 and postgresql environment with Docker and make pgadmin available
Write DiscordBot to Spreadsheets Write in Ruby and run with Docker
Pytorch execution environment with Docker
What is docker run -it?
Use GDAL with Python with Docker
Run batch with docker-compose with Java batch
Run VS Code on Docker
Docker management with VS Code
Run openvpn on Docker (windows)
Set up GitLab with docker
Run Tensorflow with THETA V
Run LIFF with Spring Boot
Microservices with DevOps Make Changes
Decomposing the Docker run command. .. ..
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
Web application built with docker (1)
I tried BIND with Docker
React environment construction with Docker
Build DynamoDB local with Docker
Run Java VM with WebAssembly
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
Build Metabase with Docker on Lightsail and make it https with nginx
Run logstash with Docker and try uploading data to Elastic Cloud