LoginSignup
5
4

More than 5 years have passed since last update.

コンテナにインストールするpython パッケージの管理

Posted at

概要

プログラムの実行に必要な python パッケージを Dockerfile に直接記述していたので,requirements を用いて一元管理する.

pip-tools で requirements の管理

requirements.in に必要なパッケージを記入する.

requirements.in
webapp2
paste
webob

Dockerfile に pip-tools のインストールと,requirements.in の追加,パッケージのインストールに関する項目を追加する.

Dockerfile
RUN apt-get update && apt-get install -y python-pip
RUN pip install -U pip pip-tools

ADD ./requirements.in ./
RUN pip-compile && \
    pip install -r requirements.txt && \
    rm requirements.txt

参考

5
4
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
5
4