开放端口目录安装

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

服务器技术 2021-10-08 19:41:28 29

导读

目录安装jupyterdocker端口映射安装jupyterpipinstalljupyter编写脚本运行:#!/bin/bash # run_jupyter.sh jupyter notebook --no-browser --ip 0.0.0.0 --port 8888 --allow-root > .log 2>&1 &am……
目录

安装 jupyterdocker 端口映射


安装 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并开放端口


1253067 TFnetwork_cn