-
-
Save Hadryan/a62416f952b4c5f466c8f49f56719683 to your computer and use it in GitHub Desktop.
Revisions
-
jgould22 revised this gist
Oct 24, 2022 . 1 changed file with 22 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,33 @@ FROM postgres:15-alpine LABEL maintainer="Jordan Gould <[email protected]>" # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh ENV PG_JOBMON_VERSION v1.4.1 ENV PG_PARTMAN_VERSION v4.7.1 # Install pg_jobmon RUN set -ex \ \ # Get some basic deps required to download the extensions and name them fetch-deps so we can delete them later && apk add --no-cache --virtual .fetch-deps \ ca-certificates \ openssl \ tar \ \ # Download pg_jobmon && wget -O pg_jobmon.tar.gz "https://github.com/omniti-labs/pg_jobmon/archive/$PG_JOBMON_VERSION.tar.gz" \ # Make a dir to store the src files && mkdir -p /usr/src/pg_jobmon \ # Extract the src files && tar \ --extract \ --file pg_jobmon.tar.gz \ --directory /usr/src/pg_jobmon \ --strip-components 1 \ # Delete the src tar && rm pg_jobmon.tar.gz \ \ # Get the depends required to build pg_jobmon and name this set of depends build-deps so we can delete them later && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ @@ -32,27 +38,40 @@ RUN set -ex \ libxml2-dev \ make \ perl \ # Change to the src && cd /usr/src/pg_jobmon \ # Build the extenison && make \ # Install the extension && make install \ # Return to home so we are ready for the next step && cd / \ # Delete the src files from this step && rm -rf /usr/src/pg_jobmon # Install pg_partman RUN set -ex \ # Download pg_partman && wget -O pg_partman.tar.gz "https://github.com/pgpartman/pg_partman/archive/$PG_PARTMAN_VERSION.tar.gz" \ # Create a folder to put the src files in && mkdir -p /usr/src/pg_partman \ # Extract the src files && tar \ --extract \ --file pg_partman.tar.gz \ --directory /usr/src/pg_partman \ --strip-components 1 \ # Delete src file tar && rm pg_partman.tar.gz \ # Move to src file folder && cd /usr/src/pg_partman \ # Build the extension && make \ # Install the extension && make install \ # Delete the src files for pg_partman && rm -rf /usr/src/pg_partman \ # Delete the dependancies for downloading and building the extensions, we no longer need them && apk del .fetch-deps .build-deps # Copy the init script -
jgould22 renamed this gist
Jan 17, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ FROM postgres:14-alpine LABEL maintainer="Jordan Gould <[email protected]>" # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh ENV PG_JOBMON_VERSION v1.4.1 ENV PG_PARTMAN_VERSION v4.6.0 # Install pg_jobmon RUN set -ex \ -
jgould22 revised this gist
Oct 17, 2020 . No changes.There are no files selected for viewing
-
jgould22 revised this gist
Oct 17, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ FROM postgres:13-alpine LABEL maintainer="Jordan Gould <[email protected]>" # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh ENV PG_JOBMON_VERSION v1.3.3 ENV PG_PARTMAN_VERSION v4.4.0 # Install pg_jobmon RUN set -ex \ -
jgould22 revised this gist
Jun 22, 2020 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ MAINTAINER Jordan Gould <[email protected]> # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh ENV PG_JOBMON_VERSION v1.3.3 ENV PG_PARTMAN_VERSION v4.4.0 # Install pg_jobmon RUN set -ex \ @@ -26,6 +26,8 @@ RUN set -ex \ autoconf \ automake \ g++ \ clang \ llvm \ libtool \ libxml2-dev \ make \ @@ -56,4 +58,4 @@ RUN set -ex \ # Copy the init script # The Docker Postgres initd script will run anything # in the directory /docker-entrypoint-initdb.d COPY initdb.sh /docker-entrypoint-initdb.d/initdb.sh -
jgould22 created this gist
Nov 12, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ FROM postgres:12-alpine MAINTAINER Jordan Gould <[email protected]> # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh ENV PG_JOBMON_VERSION v1.3.3 ENV PG_PARTMAN_VERSION v4.2.2 # Install pg_jobmon RUN set -ex \ \ && apk add --no-cache --virtual .fetch-deps \ ca-certificates \ openssl \ tar \ \ && wget -O pg_jobmon.tar.gz "https://github.com/omniti-labs/pg_jobmon/archive/$PG_JOBMON_VERSION.tar.gz" \ && mkdir -p /usr/src/pg_jobmon \ && tar \ --extract \ --file pg_jobmon.tar.gz \ --directory /usr/src/pg_jobmon \ --strip-components 1 \ && rm pg_jobmon.tar.gz \ \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ g++ \ libtool \ libxml2-dev \ make \ perl \ && cd /usr/src/pg_jobmon \ && make \ && make install \ && cd / \ && rm -rf /usr/src/pg_jobmon # Install pg_partman RUN set -ex \ && wget -O pg_partman.tar.gz "https://github.com/pgpartman/pg_partman/archive/$PG_PARTMAN_VERSION.tar.gz" \ && mkdir -p /usr/src/pg_partman \ && tar \ --extract \ --file pg_partman.tar.gz \ --directory /usr/src/pg_partman \ --strip-components 1 \ && rm pg_partman.tar.gz \ && cd /usr/src/pg_partman \ && make \ && make install \ && cd / \ && rm -rf /usr/src/pg_partman \ && apk del .fetch-deps .build-deps # Copy the init script # The Docker Postgres initd script will run anything # in the directory /docker-entrypoint-initdb.d COPY initdb.sh /docker-entrypoint-initdb.d/initdb.sh This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/bash -e echo "Creating dblink extension" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE SCHEMA dblink; CREATE EXTENSION dblink SCHEMA dblink; EOSQL echo "Creating jobmon extension" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE SCHEMA jobmon; CREATE EXTENSION pg_jobmon SCHEMA jobmon; INSERT INTO jobmon.dblink_mapping_jobmon (username, pwd) VALUES ('$POSTGRES_USER', '$POSTGRES_PASSWORD'); EOSQL echo "Creating partman extension" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE SCHEMA partman; CREATE EXTENSION pg_partman SCHEMA partman; EOSQL echo "Adding jobmon permissions" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL GRANT USAGE ON SCHEMA jobmon TO $POSTGRES_USER; GRANT USAGE ON SCHEMA dblink TO $POSTGRES_USER; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA jobmon TO $POSTGRES_USER; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA jobmon TO $POSTGRES_USER; GRANT ALL ON ALL SEQUENCES IN SCHEMA jobmon TO $POSTGRES_USER; EOSQL echo "ADDING pg_partman_bgw TO postgresql.conf" echo "shared_preload_libraries = 'pg_partman_bgw'" >> $PGDATA/postgresql.conf echo "pg_partman_bgw.interval = 3600" >> $PGDATA/postgresql.conf echo "pg_partman_bgw.role = '$POSTGRES_USER'" >> $PGDATA/postgresql.conf echo "pg_partman_bgw.dbname = '$POSTGRES_DB'" >> $PGDATA/postgresql.conf