Skip to content

Commit c62fac5

Browse files
committed
Refactor Dockerfile: Simplify Postgres library handling and streamline file copying
1 parent 654d5f5 commit c62fac5

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

circleci/images/exttester/Dockerfile

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ FROM buildpack-deps:bullseye
8989
# add unpriviliged user for tests
9090
RUN useradd -ms /bin/bash circleci
9191

92-
# bring in the built Postgres libs so pg_regress_multi’s LD_LIBRARY_PATH has something to find
93-
COPY --from=dev-tools-builder /build /build
94-
9592
RUN <<'EOF'
9693
# install dependencies
9794
set -eux
@@ -186,24 +183,7 @@ ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin/:$PATH
186183
# setup /var/run/postgresql for use with circleci
187184
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
188185

189-
# --------------------------------------------------------------------
190-
# The COPY above can white‑out /usr/lib/x86_64-linux-gnu when BuildKit
191-
# is active, removing libpq.so.* that was installed earlier. We
192-
# (re)install libpq5, recreate the helper symlink for PG ≤ 16, refresh
193-
# the loader cache, and preload the client library so Citus never
194-
# complains about symbol interposition.
195-
# --------------------------------------------------------------------
196-
ARG PG_MAJOR
197-
RUN set -eux; \
198-
# 2. Satisfy RUNPATH for PG 15/16 (harmless for ≥17)
199-
ln -sf /usr/lib/x86_64-linux-gnu/libpq.so.5 \
200-
/usr/lib/postgresql/${PG_MAJOR}/lib/libpq.so.5; \
201-
\
202-
# 3. Refresh dynamic‑linker cache
203-
echo "/usr/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/libpq.conf; \
204-
ldconfig
205-
206-
# 4. Make sure the backend and Citus load the *same* libpq object
207-
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpq.so.5
186+
# copy the collected files from the collection container at once into the final container
187+
COPY --from=dev-tools-collection /collect/ /
208188

209189
WORKDIR /home/circleci

0 commit comments

Comments
 (0)