clkao / docker-postgres-plv8

Docker image postgres with plv8
https://registry.hub.docker.com/u/clkao/postgres-plv8/
MIT License
45 stars 38 forks source link

Updated to PLV8@3.0 and Postgres 14 #42

Closed bankyadam closed 2 years ago

bankyadam commented 2 years ago

Hi,

I've managed to be able to build the latest versions of plv8 and psql with the following Dockerfile, hope that helps:

FROM postgres:14rc1

ENV PLV8_VERSION=3.0.0 \
    PLV8_SHASUM="de030f5d6b0439710efa05f4c35ffb8ef36ae754fa0e3c46d334352cf1507661"

RUN buildDependencies=" \
      build-essential \
      ca-certificates \
      curl \
      git-core \
      python \
      gpp \
      cpp \
      pkg-config \
      apt-transport-https \
      cmake \
      libc++-dev \
      wget \
      ninja-build \
      libtinfo5 \
      libglib2.0-dev \
      libc++abi-dev \
      postgresql-server-dev-$PG_MAJOR \
    " \
    runtimeDependencies=" \
      libc++1 \
    " \
  && apt-get update \
  && apt-get install -y --no-install-recommends ${buildDependencies} ${runtimeDependencies} \
  && mkdir -p /tmp/build \
  && curl -o /tmp/build/v$PLV8_VERSION.tar.gz -SL "https://github.com/plv8/plv8/archive/v${PLV8_VERSION}.tar.gz" \
  && cd /tmp/build \
  && echo $PLV8_SHASUM v$PLV8_VERSION.tar.gz | sha256sum -c \
  && tar -xzf /tmp/build/v$PLV8_VERSION.tar.gz -C /tmp/build/ \
  && cd /tmp/build/plv8-$PLV8_VERSION \
  && make \
  && make install \
  && strip /usr/lib/postgresql/${PG_MAJOR}/lib/plv8-${PLV8_VERSION}.so \
  && rm -rf /root/.vpython_cipd_cache /root/.vpython-root \
  && apt-get clean \
  && apt-get remove -y ${buildDependencies} \
  && apt-get autoremove -y \
  && rm -rf /tmp/build /var/lib/apt/lists/*
bankyadam commented 2 years ago

Created PR #43 for this.