-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-extract-ts-function
- Loading branch information
Showing
4 changed files
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
# Copied from https://github.com/supabase/pg_jsonschema/blob/master/dockerfiles/db/Dockerfile | ||
FROM postgres:16-bookworm | ||
# Based off of https://github.com/tembo-io/pgmq/blob/main/images/pgmq-pg/Dockerfile | ||
ARG PG_MAJOR_VERSION=15 | ||
|
||
FROM postgres:${PG_MAJOR_VERSION}-bookworm as build | ||
|
||
ARG PG_MAJOR_VERSION=15 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
ca-certificates \ | ||
build-essential \ | ||
pkg-config \ | ||
ca-certificates \ | ||
clang \ | ||
curl \ | ||
gcc \ | ||
libssl-dev \ | ||
libclang-dev \ | ||
postgresql-server-dev-16 \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
pkg-config \ | ||
postgresql-server-dev-${PG_MAJOR_VERSION} \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /foo | ||
ENV HOME=/foo | ||
ENV PATH=/foo/.cargo/bin:$PATH | ||
RUN chown postgres:postgres -R /foo | ||
# Install Rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
RUN $HOME/.cargo/bin/rustup default stable | ||
|
||
USER postgres | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal | ||
RUN cargo install --locked --version 0.11.0 cargo-pgrx | ||
RUN cargo pgrx init --pg16 $(which pg_config) | ||
# Install pgrx | ||
RUN $HOME/.cargo/bin/cargo install --locked --version 0.11.0 cargo-pgrx | ||
RUN $HOME/.cargo/bin/cargo pgrx init --pg${PG_MAJOR_VERSION} $(which pg_config) | ||
|
||
USER root | ||
# Install pg_uuidv7 | ||
COPY . . | ||
RUN cargo pgrx install | ||
RUN $HOME/.cargo/bin/cargo pgrx install -c $(which pg_config) | ||
|
||
FROM postgres:${PG_MAJOR_VERSION}-bookworm | ||
|
||
ARG PG_MAJOR_VERSION=15 | ||
|
||
RUN chown -R postgres:postgres /foo | ||
RUN chown -R postgres:postgres /usr/share/postgresql/16/extension | ||
RUN chown -R postgres:postgres /usr/lib/postgresql/16/lib | ||
COPY --from=build /usr/share/postgresql/${PG_MAJOR_VERSION}/extension /usr/share/postgresql/${PG_MAJOR_VERSION}/extension | ||
COPY --from=build /usr/lib/postgresql/${PG_MAJOR_VERSION}/lib /usr/lib/postgresql/${PG_MAJOR_VERSION}/lib | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters