1

I tried in my docker container(from alpine3.6) to run command to install pg_dumpall I've seen in the web:

apk update && apk upgrade

and then

apk add --no-cache postgresql-client-common

and finally

apk add --no-cache postgresql-client

Only the last of the two installs I tried worked (the one without common) but I still won't have pg_dump or pg_dumpall in my binaries.

Ayra
  • 328
  • 2
  • 12

2 Answers2

1

Try to

apk add postgresql-client

You can see all included binaries of this package in this link. This package has a pg_dumpall

https://pkgs.alpinelinux.org/contents?file=&path=&name=postgresql-client&branch=v3.8&repo=main&arch=aarch64

Meiram Chuzhenbayev
  • 898
  • 1
  • 10
  • 26
0

Each alpine version has different postgresql-client. For myself I wrote those logic:

ARG PSQL_VERSION=0
RUN if [ "$PSQL_VERSION" = "13" ]; then \
        echo "http://dl-cdn.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories; \
    elif [ "$PSQL_VERSION" = "12" ]; then \
        echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/main" >> /etc/apk/repositories; \
    elif [ "$PSQL_VERSION" = "11" ]; then \
        echo "http://dl-cdn.alpinelinux.org/alpine/v3.10/main" >> /etc/apk/repositories; \
    elif [ "$PSQL_VERSION" = "10" ]; then \
            echo "http://dl-cdn.alpinelinux.org/alpine/v3.8/main" >> /etc/apk/repositories; \
    fi
RUN apk update
RUN apk --no-cache add postgresql-client

And now you can pass needed client version:

docker build -t backuper --build-arg PSQL_VERSION=12 .