Skip to content

Official way to include extensions #340

@gmile

Description

@gmile

What is the official way of adding postgres extensions, given postgres-alpine is a base image?

I tried to add postgresql-pglogical and postgis extensions by installing respective apk packages, but this process, despite being the most intuitive and straightforward, failed for me.

Here's my Dockerfile:

FROM postgres:9.6.4-alpine

RUN apk add --update --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ postgresql-pglogical postgis

Opening a now-closed issue in apline linux tracker made me realize that in a container above I ended up having two postgreses installed:

  • one coming from the base image,
  • one coming from the apk (apk has to make sure that for given packages to install all dependencies are met; for postgresql-pglogical and postgis package called postgres is a dependency).

I can see other issues asking for clarification around adding extensions:

Maybe it makes sense to include a statement in a readme? Something like:

For any postgres extension not listed in postgres-contrib, make sure to compile them in your own image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions