openwisp / django-rest-framework-gis

Geographic add-ons for Django REST Framework. Maintained by the OpenWISP Project.
http://openwisp.org
MIT License
1.08k stars 201 forks source link

Dockerfile build filed. ERROR gdal-dev (missing) #217

Open winsento opened 4 years ago

winsento commented 4 years ago

How to reproduce:

git clone git@github.com:openwisp/django-rest-framework-gis.git
docker-compose build

Tracelog:

docker-compose build
postgres uses an image, skipping
Building test
Step 1/6 : FROM python:3.7-alpine3.8
3.7-alpine3.8: Pulling from library/python
c87736221ed0: Pull complete
c3f51b0d0765: Pull complete
a65abebf5480: Pull complete
6628a73c2c85: Pull complete
b49d22f17d2f: Pull complete
Digest: sha256:3491d1abd29b3f87ca5cb1afd34bc696855a2403df1ff854da55cb6754af1ff8
Status: Downloaded newer image for python:3.7-alpine3.8
 ---> f11f279751de
Step 2/6 : RUN apk update && apk upgrade     && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main         postgresql-client         postgresql-dev         musl-dev         gcc     && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing         gdal-dev         geos-dev         proj-dev
 ---> Running in 327df3a28f29
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.5 [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.4-286-gda0d4ca4ff [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
OK: 9571 distinct packages available
(1/7) Upgrading musl (1.1.19-r10 -> 1.1.19-r11)
(2/7) Upgrading libbz2 (1.0.6-r6 -> 1.0.6-r7)
(3/7) Upgrading expat (2.2.5-r0 -> 2.2.8-r0)
(4/7) Upgrading libcom_err (1.44.2-r0 -> 1.44.2-r2)
(5/7) Upgrading sqlite-libs (3.25.3-r0 -> 3.25.3-r3)
(6/7) Upgrading ca-certificates (20171114-r3 -> 20190108-r0)
(7/7) Upgrading musl-utils (1.1.19-r10 -> 1.1.19-r11)
Executing busybox-1.28.4-r3.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 17 MiB in 34 packages
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/24) Installing libgcc (9.2.0-r5)
(2/24) Installing libstdc++ (9.2.0-r5)
(3/24) Installing binutils (2.33.1-r0)
(4/24) Installing gmp (6.2.0-r0)
(5/24) Installing isl (0.18-r0)
(6/24) Installing libgomp (9.2.0-r5)
(7/24) Installing libatomic (9.2.0-r5)
(8/24) Installing libgphobos (9.2.0-r5)
(9/24) Installing mpfr4 (4.0.2-r1)
(10/24) Installing mpc1 (1.1.0-r1)
(11/24) Installing gcc (9.2.0-r5)
(12/24) Installing musl-dev (1.1.19-r11)
(13/24) Installing libedit (20191231.3.1-r0)
(14/24) Installing libcrypto1.1 (1.1.1d-r4)
(15/24) Installing db (5.3.28-r1)
(16/24) Installing libsasl (2.1.27-r5)
(17/24) Installing libssl1.1 (1.1.1d-r4)
(18/24) Installing libldap (2.4.48-r4)
(19/24) Installing libpq (12.1-r1)
(20/24) Installing postgresql-client (12.1-r1)
(21/24) Installing pkgconf (1.6.3-r0)
(22/24) Installing openssl-dev (1.1.1d-r4)
(23/24) Installing postgresql-libs (12.1-r1)
(24/24) Installing postgresql-dev (12.1-r1)
Executing busybox-1.28.4-r3.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 169 MiB in 58 packages
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  gdal-dev (missing):
    required by: world[gdal-dev]
  geos-dev (missing):
    required by: world[geos-dev]
  proj-dev (missing):
    required by: world[proj-dev]
ERROR: Service 'test' failed to build: The command '/bin/sh -c apk update && apk upgrade     && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main         postgresql-client         postgresql-dev         musl-dev         gcc     && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing         gdal-dev         geos-dev         proj-dev' returned a non-zero code: 3
ZelimDamian commented 4 years ago

Googling around suggested adding extra --repository:

RUN apk add --no-cache \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        gdal-dev

Doesn't help in my case.

ZelimDamian commented 4 years ago

UPDATE: Adding the community repository helps

RUN apk add --no-cache \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        gdal-dev