如何安装最新版本的Python + JupyterLab的自定义容器?

huangapple go评论47阅读模式
英文:

How to install a custom container with latest Python + JupyterLab version?

问题

创建一个自定义的Docker容器,用于与Google Workbench连接代理。

创建以下Dockerfile

FROM python:3.11.3-bullseye

# 安装JupyterLab和其他所需的包
RUN pip install jupyter -U && pip install jupyterlab

# 暴露JupyterLab端口
EXPOSE 8080

ENV pwd=""

ENTRYPOINT exec jupyter-lab --no-browser --ip=0.0.0.0 --port=8080 --port-retries=0 --allow-root --NotebookApp.token="$pwd" --NotebookApp.password="$pwd" --ServerApp.allow_origin="*" --ServerApp.root_dir="/home/jupyter" --ServerApp.allow_origin_pat="(https?://)?[0-9a-z]+-dot-[-0-9a-z]*.notebooks.googleusercontent.com" --ServerApp.disable_check_xsrf=True --ServerApp.allow_remote_access=True

  1. 构建并推送容器
PROJECT_ID=""
CONTAINER_NAME=""
CONTAINER_URL=gcr.io/${PROJECT?}/${CONTAINER_NAME?}:dev

docker build -t ${CONTAINER_URL} .
docker push ${CONTAINER_URL}
  1. 使用${CONTAINER_URL}创建一个新的用户管理笔记本,使用自定义容器。
英文:

How to create a custom Docker container to use with Google Workbench and connect to Proxy?

Create the following Dockerfile

FROM python:3.11.3-bullseye

# Install JupyterLab and any other required packages
RUN pip install jupyter -U && pip install jupyterlab

# Expose the JupyterLab port
EXPOSE 8080

ENV pwd=""

ENTRYPOINT exec jupyter-lab --no-browser --ip=0.0.0.0 --port=8080  --port-retries=0 --allow-root --NotebookApp.token="$pwd" --NotebookApp.password="$pwd" --ServerApp.allow_origin="*" --ServerApp.root_dir="/home/jupyter" --ServerApp.allow_origin_pat="(https?://)?[0-9a-z]+-dot-[\-0-9a-z]*\.notebooks\.googleusercontent\.com"  --ServerApp.disable_check_xsrf=True  --ServerApp.allow_remote_access=True

  1. Build and push container
PROJECT_ID=""
CONTAINER_NAME
CONTAINER_URL=gcr.io/${PROJECT?}/${CONTAINER_NAME?}:dev`


docker build -t ${CONTAINER_URL} .
docker push ${CONTAINER_URL}
  1. Create a new User Managed Notebook with a Custom container using ${CONTAINER_URL}

答案1

得分: 2

以下是翻译好的部分:
"只是作为一个参考,这篇帖子回答了提交的问题这里,其中一个政策组织不允许外部互联网访问,限制了在Vertex AI中进行软件包安装和/或使用不同的Python版本。"

英文:

Just as a reference, this post answers the question submitted here where a policy organization does not allow external internet access, limiting package installation and/or using different Python verions in Vertex AI.

huangapple
  • 本文由 发表于 2023年4月11日 14:19:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75982907.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定