はじめに
Python、AI初心者な自分がAI関連の部署に異動になりました。
勉強のため、まずは環境を作ろうと思ったため、Docker
でTensorFlow
インストール済みのJupyter Lab
の環境を作ったので備忘録を残します。
Dockerfile
FROM jupyter/datascience-notebook
USER root
RUN pip3 install --upgrade --no-cache-dir \
tensorflow \
jupyterlab-lsp \
'python-language-server[all]' \
jupyterlab_code_formatter \
&& rm -rf ~/.cache/pip \
&& jupyter labextension install \
@ryantam626/jupyterlab_code_formatter \
@krassowski/jupyterlab-lsp \
&& jupyter serverextension enable --py jupyterlab_code_formatter
docker-compose.yml
version: "3"
services:
jupyter:
build: .
container_name: "jupyter"
ports:
- 8888:8888
tty: true
environment:
- JUPYTER_ENABLE_LAB=yes
volumes:
- C:\work\Python:/home/jovyan/work
command: start-notebook.sh --NotebookApp.token=''
起動
docker-compose.yml
, Dockerfile
の同階層に移動し以下を実行。
起動後、localhost:8888
にアクセスで使用できる。
docker-compose up -d