Skip to content

Question: What is the best way to get PLV8 in alpine image? #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
owais opened this issue May 19, 2017 · 4 comments
Closed

Question: What is the best way to get PLV8 in alpine image? #290

owais opened this issue May 19, 2017 · 4 comments

Comments

@owais
Copy link

owais commented May 19, 2017

It seems that postgresql-contrib does not ship PLV8 extension. Does Alpine have a package for PLV8 or is it best to manually build it at the moment?

@tianon
Copy link
Member

tianon commented May 19, 2017

The postgres:X.Y-alpine images compile PostgreSQL from source (

&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
&& wget -O config/config.guess "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" \
&& wget -O config/config.sub "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
--build="$gnuArch" \
# "/usr/src/postgresql/src/backend/access/common/tupconvert.c:105: undefined reference to `libintl_gettext'"
# --enable-nls \
--enable-integer-datetimes \
--enable-thread-safety \
--enable-tap-tests \
# skip debugging info -- we want tiny size instead
# --enable-debug \
--disable-rpath \
%%UUID_CONFIG_FLAG%% \
--with-gnu-ld \
--with-pgport=5432 \
--with-system-tzdata=/usr/share/zoneinfo \
--prefix=/usr/local \
--with-includes=/usr/local/include \
--with-libraries=/usr/local/lib \
\
# these make our image abnormally large (at least 100MB larger), which seems uncouth for an "Alpine" (ie, "small") variant :)
# --with-krb5 \
# --with-gssapi \
# --with-ldap \
# --with-tcl \
# --with-perl \
# --with-python \
# --with-pam \
--with-openssl \
--with-libxml \
--with-libxslt \
&& make -j "$(nproc)" world \
&& make install-world \
&& make -C contrib install \
), so yes, any extensions necessary should also likely be compiled from source. 👍

@deinspanjer
Copy link

There is also the image clkao/postgres-plv8 which I'm very happy with.

@JRileyH
Copy link

JRileyH commented Apr 16, 2019

There is also the image clkao/postgres-plv8 which I'm very happy with.

Which is expressly not alpine.

@alexeyfadeev
Copy link

alexeyfadeev commented Oct 27, 2022

@owais @JRileyH
Look at our images (with Dockerfile links),
There are alpine-based versions as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants