欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

如何在centos的docker里安装jupyter并开放端口

程序员文章站 2022-03-18 12:49:22
目录安装 jupyterpip install jupyter编写脚本运行:#!/bin/bash# run_jupyter.shjupyter notebook --no-browser --ip...

安装 jupyter

pip install jupyter

编写脚本运行:

#!/bin/bash
# run_jupyter.sh
jupyter notebook --no-browser --ip 0.0.0.0 --port 8888 --allow-root > .log 2>&1 &

可以把这个脚本加入开机运行

docker 端口映射

先把安装好jupyter的容器提交

docker commit -a '作者' -m "add jupyter" 容器名 ubuntu:jupyter

以新镜像建立容器

docker run -itd --name jupyter ubuntu:jupyter -p 80:8888 bash

开放宿主机防火墙

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-port
firewall-cmd --query-port=80/tcp

用浏览器访问宿主机

如何在centos的docker里安装jupyter并开放端口

所以我的开发环境是这样的哈哈哈

如何在centos的docker里安装jupyter并开放端口

到此这篇关于如何在centos的docker里安装jupyter并开放端口的文章就介绍到这了,更多相关docker安装jupyter内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

相关标签: docker jupyter