sraoss / pg_ivm

IVM (Incremental View Maintenance) implementation as a PostgreSQL extension
Other
942 stars 27 forks source link

installation inside a pg docker container #86

Open abhijeetbhagat opened 5 months ago

abhijeetbhagat commented 5 months ago

how do i install this inside a docker container running pg?

koureasstavros commented 5 months ago

Lets assume you have a folder PostgeSQL and inside you have the following Dockerfile, then in the same level with Dockerfile you should have one folder called resources and inside that folder you have the necessary pg extensions like pg_ivm-1.7, inside this folder you should have all the extension files whitch also containing .sql and Makefile

# Debian GNU/Linux
FROM postgres:15.4

RUN localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8
ENV LANG en_GB.utf8

# Update System (update registries)
RUN apt-get update

WORKDIR /

# Deploy DeveloperTools #should follow postgresql version (otherwise it will throw error on package install)
RUN apt-get -y install postgresql-server-dev-15 #installs also repective python version based on postgresql version 

# Deploy Make
RUN apt-get -y install build-essential

ADD /resources/ /resources/

# Deploy PostgreSQL pg_cron (not exist as online repo)
WORKDIR /resources/pg_ivm-1.7

RUN make clean
RUN make
RUN make install

WORKDIR /