wheelアーカイブを含むローカル パッケージ ディレクトリからいくつかの python 要件をインストールしようとしています。Docker コンテナー内に要件をインストールしています。
私がフォローしている手順は次のとおりです。
$ pip install wheel
# wheel runs, outputs .whl files to wheelhouse directory
$ pip wheel --wheel-dir wheelhouse -r requirements.txt
次に、私の内部Dockerfile
:
ADD requirements.txt /tmp/requirements.txt
ADD wheelhouse /tmp/wheelhouse
# install requirements. Leave file in /tmp for now - may be useful.
RUN pip install --use-wheel --no-index --find-link /tmp/wheelhouse/ -r /tmp/requirements.txt
これは機能し、すべての要件が正しくインストールされています。
# 'app' is the name of my built docker image
$ docker run app pip list
...
psycopg2 (2.5.1)
...
ただし、実際に を使用 psycopg2
するコンテナー内で何かを実行しようとすると、次のようになります。
Error loading psycopg2 module: /usr/local/lib/python2.7/site-packages/psycopg2/_psycopg.so: undefined symbol: PyUnicodeUCS4_AsUTF8String
これは、ホイールが構築された方法と関係があると思います-pip wheel
コンテナホストマシン(Ubuntu 12.04)で実行しました。
これを修正するにはどうすればよいですか。ホイールを使用すると、コンテナー イメージのビルドにかかる時間が大幅に短縮されるため、できることならパッケージのインストールに戻りたくありません。