Skip to content

Commit

Permalink
Fix r3.1 dockerfile (#507)
Browse files Browse the repository at this point in the history
* fix copy bitcode destination

* add execute generate_upgrades before install

* add ENV PLV8_VERSION and PLV8_BRANCH
  • Loading branch information
niblings committed Nov 4, 2022
1 parent d38ab55 commit bcddd92
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions platforms/Docker/bullseye/14.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
FROM postgres:14.5-bullseye as builder

ENV PLV8_VERSION=3.1.4
ENV PLV8_BRANCH=r3.1
RUN set -ex \
&& apt-get update \
&& apt-get install -y build-essential curl python3 ninja-build git wget postgresql-server-dev-14 libtinfo5 pkg-config clang binutils \
&& apt-get install -y build-essential curl python3 ninja-build git wget postgresql-server-dev-${PG_MAJOR} libtinfo5 pkg-config clang binutils \
&& git clone https://github.com/plv8/plv8 \
&& cd plv8 \
&& git checkout r3.1 \
&& git checkout ${PLV8_BRANCH} \
&& make DOCKER=1 generate_upgrades \
&& make DOCKER=1 install \
&& strip /usr/lib/postgresql/14/lib/plv8-3.1.4.so
&& strip /usr/lib/postgresql/${PG_MAJOR}/lib/plv8-${PLV8_VERSION}.so


FROM postgres:14.5-bullseye

COPY --from=builder /usr/lib/postgresql/14/lib/plv8* /usr/lib/postgresql/14/lib/
COPY --from=builder /usr/share/postgresql/14/extension/plv8* /usr/share/postgresql/14/extension/
COPY --from=builder /usr/share/postgresql/14/extension/plls* /usr/share/postgresql/14/extension/
COPY --from=builder /usr/share/postgresql/14/extension/plcoffee* /usr/share/postgresql/14/extension/
COPY --from=builder /usr/lib/postgresql/14/lib/bitcode/plv8* /usr/lib/postgresql/14/bitcode/
ENV PLV8_VERSION=3.1.4
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/plv8* /usr/lib/postgresql/${PG_MAJOR}/lib/
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/plv8-${PLV8_VERSION}.index.bc /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/plv8-${PLV8_VERSION}/* /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/plv8-${PLV8_VERSION}/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/plv8* /usr/share/postgresql/${PG_MAJOR}/extension/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/plls* /usr/share/postgresql/${PG_MAJOR}/extension/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/plcoffee* /usr/share/postgresql/${PG_MAJOR}/extension/


RUN mkdir -p /var/log/postgres \
Expand Down

0 comments on commit bcddd92

Please sign in to comment.