azavea / climate-change-api

Apache License 2.0
0 stars 0 forks source link

Update Dockerfile to use Debian Stretch instead of Jessie base image #880

Closed maurizi closed 5 years ago

maurizi commented 5 years ago

We've recently encountered an issue an issue building the django docker image for this project:

Step 4/8 : RUN set -ex     && deps="        libgdal-dev         libmemcached-dev         python-dev         make     "     && buildDeps="        build-essential         git     "    && apt-get update && apt-get install -y ${buildDeps} ${deps} --no-install-recommends     && pip install --no-cache-dir            numpy==$(grep "numpy" /tmp/requirements.txt | cut -d= -f3)     && pip install --no-cache-dir -r /tmp/requirements.txt     && rm -rf /tmp/*     && apt-get purge -y --auto-remove ${buildDeps}     && rm -rf /var/lib/apt/lists/*
 ---> Running in c222193d45cb
+ deps=        libgdal-dev         libmemcached-dev         python-dev         make     
+ buildDeps=        build-essential         git     
+ apt-get update
Get:1 http://apt.postgresql.org jessie-pgdg InRelease [56.5 kB]
Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Ign http://deb.debian.org jessie-updates InRelease
Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
Ign http://deb.debian.org jessie-updates Release.gpg
Get:4 http://deb.debian.org jessie Release [148 kB]
Ign http://deb.debian.org jessie-updates Release
Err http://deb.debian.org jessie-updates/main amd64 Packages

Err http://deb.debian.org jessie-updates/main amd64 Packages

Err http://deb.debian.org jessie-updates/main amd64 Packages

Err http://deb.debian.org jessie-updates/main amd64 Packages

Err http://deb.debian.org jessie-updates/main amd64 Packages
  404  Not Found
Get:5 http://apt.postgresql.org jessie-pgdg/main amd64 Packages [204 kB]
Get:6 http://apt.postgresql.org jessie-pgdg/9.6 amd64 Packages [1690 B]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Get:8 http://security.debian.org jessie/updates/main amd64 Packages [824 kB]
Fetched 10.4 MB in 39s (263 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
Service 'django' failed to build: The command '/bin/sh -c set -ex     && deps="        libgdal-dev         libmemcached-dev         python-dev         make     "     && buildDeps="        build-essential         git     "    && apt-get update && apt-get install -y ${buildDeps} ${deps} --no-install-recommends     && pip install --no-cache-dir            numpy==$(grep "numpy" /tmp/requirements.txt | cut -d= -f3)     && pip install --no-cache-dir -r /tmp/requirements.txt     && rm -rf /tmp/*     && apt-get purge -y --auto-remove ${buildDeps}     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

DRIVER recently encountered a similar issue (see https://azavea.slack.com/archives/C09PG4RB7/p1553618703032300 and https://azavea.slack.com/archives/C09PG4RB7/p1553619814032900) and the indication is that this is caused by the jessie-updates APT repository no longer being available. We could potentially work around this with by adding following line to the Dockerfile:

RUN sed -i.bak '/jessie-updates/d' /etc/apt/sources.list

A bug report was filed so it is possible this issue will be resolved by the Debian team.

We could also upgrade to Debian Stretch. The base image we're using is from https://github.com/azavea/docker-django, however we no longer maintain a Django 1.10 image, so we can't simply upgrade to a new base image. We could however upgrade to Django 1.11 (#411) would also upgrade Debian to Stretch as a side-effect.