? 構(gòu)建鏡像
1捻艳、編輯 Dockerfile
FROM python:3
# 安裝 Nodejs
RUN apt update && curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt install -y nodejs
# 安裝 jupyterlab
RUN python -m pip install jupyterlab
# 安裝 jupyterlab 插件
RUN jupyter labextension install @jupyterlab/git && pip install jupyterlab-git && jupyter serverextension enable --py jupyterlab_git
# 設(shè)置默認(rèn)環(huán)境變量
ENV NOTEBOOK_APP_TOKEN=anoyi NOTEBOOK_DIR=/home
# 暴露端口號(hào)
EXPOSE 8888
# 運(yùn)行 jupyterlab
CMD jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token=${NOTEBOOK_APP_TOKEN} --notebook-dir=${NOTEBOOK_DIR}
2、構(gòu)建鏡像
docker build -t jupyterlab .