1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Python + Jupyter Labの開発環境をDockerで作成してみた。

1
Last updated at Posted at 2025-09-28

目的

・Dockerを使用して最小構成(python + Jupyter Lab)のコンテナを作成してみる(Windows版)
・個人の記録用


この記事のターゲット

・ DcokerでPythonの開発環境を用意したい方
・ DcokerでJupyter Labの開発環境を用意したい方


手順

  1. Dockerfileを作成する

    #ベースイメージを指定
    FROM python:3.11-slim
    
    #作業ディレクトリを作成
    WORKDIR / app 
    
    #必要なパッケージをインストール
    RUN pip install --no-cache-dir jupyterlab
    
    #ポートを開放(コンテナ外化r多アクセスするため)
    EXPOSE 8888
    
    #コンテナ起動時にJupyter Labを立ち上げる
    CMD ["jupyter" , "lab" , "--ip=0.0.0.0" , "--port=8888"  , "--allow-root" , "--no-browser"]
    
  2. Dockerfileの内容のイメージを作成する

    docker build -t dev-jupyter .
    
  3. 作成したイメージからコンテナを作成する

    docker run -it --rm -p 8888:8888 -v ${PWD}:/app dev-jupyter
    
  4. URLが作成されるのでアクセス

    ---jupyterlab.png


まとめ

・ Python + Jupyter Labの構成のコンテナの作成方法を記載した。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?