psycopg2 installation for python:2.7-alpine in Docker : <p>To use PostgreSql in python I need to  </p>

<pre><code>pip install psycopg2   
</code></pre>

<p>However, it has dependency on libpq-dev and python-dev. I wonder how can I install the dependencies in alpine? Thanks.</p>

<p>Here is a Dockerfile:</p>

<pre><code>FROM python:2.7-alpine

RUN apk add python-dev libpq-dev
RUN pip install psycopg2
</code></pre>

<p>and the output is:</p>

<blockquote>
  <p>Step 3 : RUN apk add python-dev libpq-dev  ---> Running in
  3223b1bf7cde WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file
  or directory WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file
  or directory ERROR: unsatisfiable constraints:   libpq-dev (missing):
      required by: world[libpq-dev]   python-dev (missing):
      required by: world[python-dev] ERROR: Service 'service' failed to build: The command '/bin/sh -c apk add python-dev libpq-dev' returned
  a non-zero code: 2</p>
</blockquote>
