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
- 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}
- Create a new User Managed Notebook with a Custom container using
${CONTAINER_URL}