如何使用Docker部署最新版JupyterHub
拉取鏡像
docker pull jupyterhub/jupyterhub:latest
啟動鏡像
docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub:latest jupyterhub
進入容器
docker exec -it jupyterhub bash
生成jupyterhub的配置文件
jupyterhub --generate-config # 有需要可以安裝中文庫,根據(jù)自己需求進行處理,本教程不對此步驟做詳細說明 pip install jupyterlab-language-pack-zh-CN -i https://mirrors.aliyun.com/pypi/simple
更新依賴并安裝vim
apt-get update && apt install vim -y
升級組件庫
pip install jupyterhub --upgrade -i https://mirrors.aliyun.com/pypi/simple pip install notebook --upgrade -i https://mirrors.aliyun.com/pypi/simple
創(chuàng)建用戶
adduser jupyterhub
執(zhí)行命令并輸入密碼,建議密碼也設(shè)置為:jupyterhub,方便理解下面的步驟。
更改home目錄權(quán)限
chmod -R 777 /home
檢查home目錄是否存在剛剛創(chuàng)建用戶時對應(yīng)需要生成的目錄,若沒有則手動創(chuàng)建。
cd /home ll # 若沒有目錄 mkdir jupyterhub # 目錄授權(quán) chown jupyterhub:jupyterhub jupyterhub -R
更新配置文件
cd /srv/jupyterhub && vim jupyterhub_config.py
追加如下內(nèi)容,切記是追加?。?!
c.Authenticator.allow_all = True c.Authenticator.allow_existing_users = True c.Authenticator.admin_users = {'jupyterhub'} # 管理員用戶 c.DummyAuthenticator.password = "jupyterhub" # 初始密碼設(shè)置 c.JupyterHub.admin_access = True c.LocalAuthenticator.create_system_users=True c.Spawner.notebook_dir = '~' c.Spawner.default_url = '/lab' c.Spawner.args = ['--allow-root'] c.JupyterHub.services = [ { 'name': 'idle-culler', 'command': ['python3', '-m', 'jupyterhub_idle_culler', '--timeout=3600'], 'admin':True } ]
訪問驗證
部署完畢后訪問:http://[ip]:8000,例如:http://localhost:8000,輸入配置文件中的用戶名和密碼。
效果如下:
到此這篇關(guān)于使用Docker部署最新版JupyterHub的文章就介紹到這了,更多相關(guān)Docker部署最新版JupyterHub內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
docker中修改mysql最大連接數(shù)及配置文件的實現(xiàn)
這篇文章主要介紹了docker中修改mysql最大連接數(shù)及配置文件的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-12-12云原生教程之使用Docker部署webssh工具sshwifty
Sshwifty是一個開源的WebSSH?&?WebTelnet客戶端,下面這篇文章主要給大家介紹了關(guān)于云原生教程之使用Docker部署webssh工具sshwifty的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下2023-03-03DockerCE之執(zhí)行docker info出現(xiàn)兩條警告信息及解決方案
這篇文章主要介紹了DockerCE之執(zhí)行docker info出現(xiàn)兩條警告信息及解決方案,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-02-02