Skip to content

Commit e4a927a

Browse files
committed
Upgrade postgres-client to v12 in Docker image
This is required to have a fully compatible client with the new features from v12, which is the one that we are using on our docker setup, but also in production. As a example, the following command fails with the old client: psql (10.15 (Ubuntu 10.15-0ubuntu0.18.04.1), server 12.5 (Debian 12.5-1.pgdg100+1)) WARNING: psql major version 10, server major version 12. Some psql features might not work. Type "help" for help. docs_db=# \d oauth_remoterepository ERROR: column c.relhasoids does not exist LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi... (note the differences between client and server versions) We will need to update this also in our production images.
1 parent 29c2360 commit e4a927a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dockerfiles/Dockerfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@ RUN apt-get -y install \
2020
build-essential \
2121
python3-pip \
2222
python3-dev \
23-
postgresql-client \
2423
libmysqlclient-dev \
2524
libfreetype6 \
2625
libjpeg-dev \
2726
sqlite \
2827
netcat \
2928
telnet
3029

30+
# https://www.postgresql.org/download/linux/ubuntu/
31+
# Use PostgreSQL client 12 from official PostgreSQL Ubuntu's repository to avoid this WARNING
32+
# WARNING: psql major version 10, server major version 12.
33+
# Some psql features might not work.
34+
# TODO: remove this when upgrading to Ubuntu 20.04 LTS
35+
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
36+
RUN curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
37+
RUN apt-get -y update
38+
RUN apt-get -y install postgresql-client-12
39+
3140
# Uncomment en_US.UTF-8 locale and generate it
3241
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
3342
locale-gen

0 commit comments

Comments
 (0)