title: ERROR: unsatisfiable constraints using apk in dockerfile
body: <p>I'm trying to install postgis into a postgres container.
  Dockerfile:</p>
  
  <pre><code>FROM postgres:9.6.4-alpine
  
  RUN apk update \
      &amp;&amp; apk add -u postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  COPY ./scripts/postgis.sh  /docker-entrypoint-initdb.d/postgis.sh
  </code></pre>
  
  <p>postgis.sh:</p>
  
  <pre><code>#!/bin/sh
  
  for DB in $(psql -t -c  "SELECT datname from pg_database where datname = 'backend'"); do
      echo "Loading PostGIS extensions into $DB"
      "${psql[@]}" --dbname="$DB" &lt;&lt;-'EOSQL'
          CREATE EXTENSION IF NOT EXISTS postgis;
  EOSQL
  done
  </code></pre>
  
  <p>I got this error:</p>
  
  <blockquote>
    <p>ERROR: unsatisfiable constraints:
      postgresql-9.6-postgis-2.4 (missing):
        required by:
                     world[postgresql-9.6-postgis-2.4]
      postgresql-9.6-postgis-2.4-scripts (missing):
        required by:
                     world[postgresql-9.6-postgis-2.4-scripts]
    The command '/bin/sh -c apk update     &amp;&amp; apk add -u postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts     &amp;&amp; rm -rf /var/lib/apt/lists/*' returned a non-zero code: 2</p>
  </blockquote>
  
  <p>I found similar questions such as :</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/48417891/error-unsatisfiable-constraints-while-installing-package-in-alpine">ERROR: unsatisfiable constraints: while installing package in alpine
  </a></li>
  <li><a href="https://stackoverflow.com/questions/36530620/error-unsatisfiable-constraints-on-php7-fpm-alpine">ERROR: unsatisfiable constraints - on php:7-fpm-alpine</a></li>
  </ol>
  
  <p>But it doesn't solve my problem.How can I add postgis extension to my postgres container with apk?</p>