File tree Expand file tree Collapse file tree 4 files changed +59
-7
lines changed
Expand file tree Collapse file tree 4 files changed +59
-7
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,23 @@ apt-get install -y --no-install-recommends --allow-downgrades \
7878 postgresql-${PG_MAJOR}-dbgsym=${pgdg_version} \
7979 postgresql-server-dev-${PG_MAJOR}=${pgdg_version} \
8080
81- # clear apt cache
82- rm -rf /var/lib/apt/lists/*
81+ # --------------------------------------------------------------------
82+ # libpq lives in /usr/lib/x86_64-linux-gnu, but every PostgreSQL binary
83+ # looks first in $ORIGIN/../lib (→ /usr/lib/postgresql/${PG_MAJOR}/lib).
84+ # Drop one symlink there and refresh the loader cache so initdb/psql/etc.
85+ # can start without LD_LIBRARY_PATH.
86+ # --------------------------------------------------------------------
87+
88+ # clear apt cache
89+ rm -rf /var/lib/apt/lists/* && \
90+
91+ ln -s /usr/lib/x86_64-linux-gnu/libpq.so.5 \
92+ /usr/lib/postgresql/${PG_MAJOR}/lib/libpq.so.5 && \
93+ echo "/usr/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/libpq.conf && \
94+ ldconfig
8395EOF
8496
97+
8598# add postgress to the path
8699ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin/:$PATH
87100
Original file line number Diff line number Diff line change @@ -67,9 +67,22 @@ apt-get install -y --no-install-recommends --allow-downgrades \
6767 postgresql-${PG_MAJOR}-dbgsym=${pgdg_version} \
6868 postgresql-server-dev-${PG_MAJOR}=${pgdg_version}
6969
70- # clear apt cache
71- rm -rf /var/lib/apt/lists/*
70+ # --------------------------------------------------------------------
71+ # libpq lives in /usr/lib/x86_64-linux-gnu, but every PostgreSQL binary
72+ # looks first in $ORIGIN/../lib (→ /usr/lib/postgresql/${PG_MAJOR}/lib).
73+ # Drop one symlink there and refresh the loader cache so initdb/psql/etc.
74+ # can start without LD_LIBRARY_PATH.
75+ # --------------------------------------------------------------------
76+
77+ # clear apt cache
78+ rm -rf /var/lib/apt/lists/* && \
79+
80+ ln -s /usr/lib/x86_64-linux-gnu/libpq.so.5 \
81+ /usr/lib/postgresql/${PG_MAJOR}/lib/libpq.so.5 && \
82+ echo "/usr/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/libpq.conf && \
83+ ldconfig
7284EOF
7385
86+
7487USER circleci
7588WORKDIR /home/circleci
Original file line number Diff line number Diff line change @@ -174,10 +174,23 @@ apt-get install -y --no-install-recommends --allow-downgrades \
174174 postgresql-server-dev-${PG_MAJOR}=${pgdg_version} \
175175 postgresql-${PG_MAJOR}-wal2json \
176176
177+ # --------------------------------------------------------------------
178+ # libpq lives in /usr/lib/x86_64-linux-gnu, but every PostgreSQL binary
179+ # looks first in $ORIGIN/../lib (→ /usr/lib/postgresql/${PG_MAJOR}/lib).
180+ # Drop one symlink there and refresh the loader cache so initdb/psql/etc.
181+ # can start without LD_LIBRARY_PATH.
182+ # --------------------------------------------------------------------
183+
177184 # clear apt cache
178- rm -rf /var/lib/apt/lists/*
185+ rm -rf /var/lib/apt/lists/* && \
186+
187+ ln -s /usr/lib/x86_64-linux-gnu/libpq.so.5 \
188+ /usr/lib/postgresql/${PG_MAJOR}/lib/libpq.so.5 && \
189+ echo "/usr/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/libpq.conf && \
190+ ldconfig
179191EOF
180192
193+
181194# add postgress to the path
182195ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin/:$PATH
183196
Original file line number Diff line number Diff line change @@ -77,10 +77,23 @@ apt-get install -y --no-install-recommends --allow-downgrades \
7777 postgresql-${PG_MAJOR}-dbgsym=${pgdg_version} \
7878 postgresql-server-dev-${PG_MAJOR}=${pgdg_version} \
7979
80- # clear apt cache
81- rm -rf /var/lib/apt/lists/*
80+ # --------------------------------------------------------------------
81+ # libpq lives in /usr/lib/x86_64-linux-gnu, but every PostgreSQL binary
82+ # looks first in $ORIGIN/../lib (→ /usr/lib/postgresql/${PG_MAJOR}/lib).
83+ # Drop one symlink there and refresh the loader cache so initdb/psql/etc.
84+ # can start without LD_LIBRARY_PATH.
85+ # --------------------------------------------------------------------
86+
87+ # clear apt cache
88+ rm -rf /var/lib/apt/lists/* && \
89+
90+ ln -s /usr/lib/x86_64-linux-gnu/libpq.so.5 \
91+ /usr/lib/postgresql/${PG_MAJOR}/lib/libpq.so.5 && \
92+ echo "/usr/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/libpq.conf && \
93+ ldconfig
8294EOF
8395
96+
8497# add postgress to the path
8598ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin/:$PATH
8699
You can’t perform that action at this time.
0 commit comments