kartoza / docker-postgis

Dockerfile for postgis
GNU General Public License v2.0
651 stars 317 forks source link

Struggling to build for arm due to timescaledb #351

Closed ostenbom closed 2 years ago

ostenbom commented 2 years ago

Hey there! 👋

I am struggling to build this image for the arm64 architecture. I think it has to do with timescaledb-2-postgresql-13/14 not existing for arm on the Debian package registry.

Maybe installing timescale could be optionally enabled with env during build until support comes around, or do you have any other ideas on workarounds?

Here's the command I used to build docker buildx build --platform linux/amd64,linux/arm64 --build-arg POSTGRES_MAJOR_VERSION=14 --build-arg POSTGIS_MAJOR_VERSION=3 .

And the output I'm getting:

------
 > [linux/arm64 postgis-prod  2/12] RUN set -eux     && export DEBIAN_FRONTEND=noninteractive     &&  apt-get update     && apt-get -y --no-install-recommends install postgresql-client-14         postgresql-common postgresql-14         postgresql-14-postgis-3         netcat postgresql-14-ogr-fdw         postgresql-14-postgis-3-scripts         postgresql-plpython3-14 postgresql-14-pgrouting         postgresql-server-dev-14 postgresql-14-cron         timescaledb-2-postgresql-14 timescaledb-tools:
#40 0.045 + export DEBIAN_FRONTEND=noninteractive
#40 0.045 + apt-get update
#40 0.183 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
#40 0.183 Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
#40 0.393 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
#40 0.393 Get:4 http://security.debian.org/debian-security bullseye-security/main arm64 Packages [94.6 kB]
#40 0.405 Get:5 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [86.7 kB]
#40 0.413 Get:6 http://deb.debian.org/debian bullseye/main arm64 Packages [8,068 kB]
#40 0.573 Get:7 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main arm64 Packages [227 kB]
#40 2.193 Get:8 https://packagecloud.io/timescale/timescaledb/debian bullseye InRelease [24.4 kB]
#40 4.232 Get:9 https://packagecloud.io/timescale/timescaledb/debian bullseye/main arm64 Packages [543 B]
#40 5.518 Get:10 http://deb.debian.org/debian bullseye-updates/main arm64 Packages [2,600 B]
#40 6.180 Fetched 8,704 kB in 6s (1,424 kB/s)
#40 6.180 Reading package lists...
#40 6.462 + apt-get -y --no-install-recommends install postgresql-client-14 postgresql-common postgresql-14 postgresql-14-postgis-3 netcat postgresql-14-ogr-fdw postgresql-14-postgis-3-scripts postgresql-plpython3-14 postgresql-14-pgrouting postgresql-server-dev-14 postgresql-14-cron timescaledb-2-postgresql-14 timescaledb-tools
#40 6.470 Reading package lists...
#40 6.742 Building dependency tree...
#40 6.816 Reading state information...
#40 6.868 E: Unable to locate package timescaledb-2-postgresql-14
NyakudyaA commented 2 years ago

Hey there! wave

I am struggling to build this image for the arm64 architecture. I think it has to do with timescaledb-2-postgresql-13/14 not existing for arm on the Debian package registry.

Maybe installing timescale could be optionally enabled with env during build until support comes around, or do you have any other ideas on workarounds?

Here's the command I used to build docker buildx build --platform linux/amd64,linux/arm64 --build-arg POSTGRES_MAJOR_VERSION=14 --build-arg POSTGIS_MAJOR_VERSION=3 .

And the output I'm getting:

------
 > [linux/arm64 postgis-prod  2/12] RUN set -eux     && export DEBIAN_FRONTEND=noninteractive     &&  apt-get update     && apt-get -y --no-install-recommends install postgresql-client-14         postgresql-common postgresql-14         postgresql-14-postgis-3         netcat postgresql-14-ogr-fdw         postgresql-14-postgis-3-scripts         postgresql-plpython3-14 postgresql-14-pgrouting         postgresql-server-dev-14 postgresql-14-cron         timescaledb-2-postgresql-14 timescaledb-tools:
#40 0.045 + export DEBIAN_FRONTEND=noninteractive
#40 0.045 + apt-get update
#40 0.183 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
#40 0.183 Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
#40 0.393 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
#40 0.393 Get:4 http://security.debian.org/debian-security bullseye-security/main arm64 Packages [94.6 kB]
#40 0.405 Get:5 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [86.7 kB]
#40 0.413 Get:6 http://deb.debian.org/debian bullseye/main arm64 Packages [8,068 kB]
#40 0.573 Get:7 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main arm64 Packages [227 kB]
#40 2.193 Get:8 https://packagecloud.io/timescale/timescaledb/debian bullseye InRelease [24.4 kB]
#40 4.232 Get:9 https://packagecloud.io/timescale/timescaledb/debian bullseye/main arm64 Packages [543 B]
#40 5.518 Get:10 http://deb.debian.org/debian bullseye-updates/main arm64 Packages [2,600 B]
#40 6.180 Fetched 8,704 kB in 6s (1,424 kB/s)
#40 6.180 Reading package lists...
#40 6.462 + apt-get -y --no-install-recommends install postgresql-client-14 postgresql-common postgresql-14 postgresql-14-postgis-3 netcat postgresql-14-ogr-fdw postgresql-14-postgis-3-scripts postgresql-plpython3-14 postgresql-14-pgrouting postgresql-server-dev-14 postgresql-14-cron timescaledb-2-postgresql-14 timescaledb-tools
#40 6.470 Reading package lists...
#40 6.742 Building dependency tree...
#40 6.816 Reading state information...
#40 6.868 E: Unable to locate package timescaledb-2-postgresql-14

I think it makes sense to have it as a build arg if it gives issues and then we could have a separate GitHub workflow to build and tag this appropriately. @lucernae what are your thoughts