Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL 9.6.9 on Alpine Linux (arm32v6) in Docker container - how to install correct postgresql-contrib package?

I need to install PostgreSQL 9.6.9 with uuid-ossp support in a Docker container on a 32-bit ARM system (its a QNAP NAS, CPU: Annapurna Labs Alpine AL-314).

I found the arm32v6/postgres images and installed arm32v6/postgres:9.6.9-alpine. This is working smoothly, but lacks the postgresql-contrib package. As far as I understand, I need to install postgresql-contrib to get uuid-ossp support.

I opened a CLI in the container and tried:

# apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/armhf/APKINDEX.tar.gz
v3.7.0-215-g16971064c0 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-207-gac61833f9b [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 8879 distinct packages available
# apk add postgresql-contrib=9.6.9-r0
ERROR: unsatisfiable constraints:
  postgresql-contrib-10.4-r0:
    breaks: world[postgresql-contrib=9.6.9-r0]

How can I install the correct version of postgresql-contrib? Or can I just use postgresql-contrib-10.4-r0 with PostgreSQL 9.6.9?

like image 911
x-ray Avatar asked Jan 19 '26 11:01

x-ray


1 Answers

Just use base alpine image and install PostgreSQL completely from Alpine's official packages: postgresql and postgresql-contrib. The last stable Alpine providing PostgreSQL 9.6 is v3.6, which is two versions behind, but still supported. Alpine v3.7 provides only 10.4.

Also don't specify exact version to apk add. Alpine provides only single version of the package per branch (e.g. v3.7, v3.8, edge). Once we release postgresql-contrib 9.6.9-r1 or 9.6.10-r0 (e.g. fixing some security issue), 9.6.9-r0 will not be available anymore and your apk add postgresql-contrib=9.6.9-r0 will fail.

These specialized Docker images “packaging” something that is already properly packaged in Alpine are mostly totally useless and just causes confusions and problems. I can't even count how many times I'm responding to this type of issue on SO.

like image 105
Jakub Jirutka Avatar answered Jan 21 '26 04:01

Jakub Jirutka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!