Skip to content
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

installation inside a pg docker container #86

Open
abhijeetbhagat opened this issue Apr 25, 2024 · 2 comments
Open

installation inside a pg docker container #86

abhijeetbhagat opened this issue Apr 25, 2024 · 2 comments
Labels
question Further information is requested

Comments

@abhijeetbhagat
Copy link

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

@koureasstavros
Copy link

koureasstavros commented Apr 30, 2024

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 /

@yugo-n yugo-n added the question Further information is requested label Oct 14, 2024
@Saghen
Copy link

Saghen commented Nov 18, 2024

I built without a resources folder and without including build tools in the final output by using a multi-stage build (also works with bitnami/postgresql:15.9.0)

FROM postgres:15.9 AS builder

RUN apt-get update && apt-get -y install git postgresql-server-dev-15 build-essential && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/sraoss/pg_ivm
WORKDIR /pg_ivm

RUN git checkout v1.9
RUN make
RUN make DESTDIR=/pg_ivm/output install

FROM postgres:15.9
COPY --from=builder /pg_ivm/output /

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

No branches or pull requests

4 participants