Search code examples
postgresqldocker

how to install postgresql-client 17 on docker alpine using apk


Im trying to install postgresql-client17

FROM mcr.microsoft.com/azure-cli:2.9.1

RUN apk update
RUN apk add postgresql-client17

I am getting the error:

 > [sa-cron 3/3] RUN apk add postgresql-client17:                                                                                                                    
0.237 ERROR: unsatisfiable constraints:
0.237   postgresql-client17 (missing):

I have tried many combinations of postgresql-client17 and postgresql-client-17 and postgresql-client17-2 and so...
I get the same error. I must use this docer image:
mcr.microsoft.com/azure-cli:2.9.1 Thanks


Solution

  • You can change the Dockerfile as below:

    FROM mcr.microsoft.com/azure-cli:2.9.1
    
    RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' > /etc/apk/repositories
    RUN apk update --allow-untrusted
    RUN apk upgrade --allow-untrusted
    RUN apk add postgresql17-client --allow-untrusted
    

    it should works.