-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Grigorev
committed
Apr 12, 2024
0 parents
commit 0978d6b
Showing
12 changed files
with
780 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
FROM alpine:3.19 | ||
|
||
ENV PG_MAJOR 12 | ||
ENV PG_VERSION 12.18 | ||
ENV PG_SHA256 4f9919725d941ce9868e07fe1ed1d3a86748599b483386547583928b74c3918a | ||
ENV PG_REPACK_VERSION 1.4.5 | ||
|
||
ENV LANG en_US.utf8 | ||
WORKDIR /pg_repack | ||
|
||
ENV DOCKER_PG_LLVM_DEPS \ | ||
llvm15-dev \ | ||
clang15 | ||
|
||
RUN set -eux; \ | ||
\ | ||
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ | ||
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \ | ||
mkdir -p /usr/src/postgresql; \ | ||
tar \ | ||
--extract \ | ||
--file postgresql.tar.bz2 \ | ||
--directory /usr/src/postgresql \ | ||
--strip-components 1 \ | ||
; \ | ||
rm postgresql.tar.bz2; \ | ||
\ | ||
apk add --no-cache --virtual .build-deps \ | ||
$DOCKER_PG_LLVM_DEPS \ | ||
bison \ | ||
coreutils \ | ||
dpkg-dev dpkg \ | ||
flex \ | ||
g++ \ | ||
gcc \ | ||
krb5-dev \ | ||
libc-dev \ | ||
libedit-dev \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
linux-headers \ | ||
make \ | ||
openldap-dev \ | ||
openssl-dev \ | ||
perl-dev \ | ||
perl-ipc-run \ | ||
perl-utils \ | ||
python3-dev \ | ||
tcl-dev \ | ||
util-linux-dev \ | ||
zlib-dev \ | ||
icu-dev \ | ||
readline-dev \ | ||
; \ | ||
\ | ||
cd /usr/src/postgresql; \ | ||
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ | ||
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ | ||
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ | ||
\ | ||
export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ | ||
export CLANG=clang-15; \ | ||
\ | ||
./configure \ | ||
--enable-option-checking=fatal \ | ||
--build="$gnuArch" \ | ||
--enable-integer-datetimes \ | ||
--enable-thread-safety \ | ||
--enable-tap-tests \ | ||
--disable-rpath \ | ||
--with-uuid=e2fs \ | ||
--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 \ | ||
--with-gssapi \ | ||
--with-ldap \ | ||
--with-tcl \ | ||
--with-perl \ | ||
--with-python \ | ||
--with-openssl \ | ||
--with-libxml \ | ||
--with-libxslt \ | ||
--with-icu \ | ||
--with-llvm \ | ||
; \ | ||
make -j "$(nproc)" world; \ | ||
make install-world; \ | ||
make -C contrib install; \ | ||
\ | ||
runDeps="$( \ | ||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ | ||
| tr ',' '\n' \ | ||
| sort -u \ | ||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ | ||
| grep -v -e perl -e python -e tcl \ | ||
)"; \ | ||
apk add --no-cache --virtual .postgresql-rundeps \ | ||
$runDeps \ | ||
bash \ | ||
su-exec \ | ||
tzdata \ | ||
zstd \ | ||
icu-data-full \ | ||
$([ "$(apk --print-arch)" != 'ppc64le' ] && echo 'nss_wrapper') \ | ||
; \ | ||
wget -O pg_repack.zip http://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip \ | ||
&& unzip pg_repack.zip || true && rm -f pg_repack.zip \ | ||
&& cd pg_repack-${PG_REPACK_VERSION} \ | ||
&& make \ | ||
&& make install; \ | ||
apk del --no-network .build-deps; \ | ||
cd /; \ | ||
rm -rf \ | ||
/usr/src/postgresql \ | ||
/usr/local/share/doc \ | ||
/usr/local/share/man \ | ||
; \ | ||
\ | ||
pg_repack --version | ||
|
||
COPY docker_entrypoint.sh /bin/ | ||
|
||
ENTRYPOINT ["/bin/docker_entrypoint.sh"] | ||
CMD ["-no-superuser-check"] |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
ARG1=$1 | ||
|
||
case "${ARG1}" in | ||
"bash" | "sh" | "psql" | "pgbench" | "pg_dump" | "pg_dumpall") | ||
echo ${ARG1} | ||
exec "$@" | ||
;; | ||
*) | ||
exec /usr/local/bin/pg_repack "$@" | ||
;; | ||
esac |
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 |
---|---|---|
@@ -0,0 +1,127 @@ | ||
FROM alpine:3.19 | ||
|
||
ENV PG_MAJOR 13 | ||
ENV PG_VERSION 13.14 | ||
ENV PG_SHA256 b8df078551898960bd500dc5d38a177e9905376df81fe7f2b660a1407fa6a5ed | ||
ENV PG_REPACK_VERSION 1.4.6 | ||
|
||
ENV LANG en_US.utf8 | ||
WORKDIR /pg_repack | ||
|
||
ENV DOCKER_PG_LLVM_DEPS \ | ||
llvm15-dev \ | ||
clang15 | ||
|
||
RUN set -eux; \ | ||
\ | ||
wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; \ | ||
echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; \ | ||
mkdir -p /usr/src/postgresql; \ | ||
tar \ | ||
--extract \ | ||
--file postgresql.tar.bz2 \ | ||
--directory /usr/src/postgresql \ | ||
--strip-components 1 \ | ||
; \ | ||
rm postgresql.tar.bz2; \ | ||
\ | ||
apk add --no-cache --virtual .build-deps \ | ||
$DOCKER_PG_LLVM_DEPS \ | ||
bison \ | ||
coreutils \ | ||
dpkg-dev dpkg \ | ||
flex \ | ||
g++ \ | ||
gcc \ | ||
krb5-dev \ | ||
libc-dev \ | ||
libedit-dev \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
linux-headers \ | ||
make \ | ||
openldap-dev \ | ||
openssl-dev \ | ||
perl-dev \ | ||
perl-ipc-run \ | ||
perl-utils \ | ||
python3-dev \ | ||
tcl-dev \ | ||
util-linux-dev \ | ||
zlib-dev \ | ||
icu-dev \ | ||
readline-dev \ | ||
; \ | ||
\ | ||
cd /usr/src/postgresql; \ | ||
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ | ||
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \ | ||
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \ | ||
\ | ||
export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; \ | ||
export CLANG=clang-15; \ | ||
\ | ||
./configure \ | ||
--enable-option-checking=fatal \ | ||
--build="$gnuArch" \ | ||
--enable-integer-datetimes \ | ||
--enable-thread-safety \ | ||
--enable-tap-tests \ | ||
--disable-rpath \ | ||
--with-uuid=e2fs \ | ||
--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 \ | ||
--with-gssapi \ | ||
--with-ldap \ | ||
--with-tcl \ | ||
--with-perl \ | ||
--with-python \ | ||
--with-openssl \ | ||
--with-libxml \ | ||
--with-libxslt \ | ||
--with-icu \ | ||
--with-llvm \ | ||
; \ | ||
make -j "$(nproc)" world; \ | ||
make install-world; \ | ||
make -C contrib install; \ | ||
\ | ||
runDeps="$( \ | ||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ | ||
| tr ',' '\n' \ | ||
| sort -u \ | ||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ | ||
| grep -v -e perl -e python -e tcl \ | ||
)"; \ | ||
apk add --no-cache --virtual .postgresql-rundeps \ | ||
$runDeps \ | ||
bash \ | ||
su-exec \ | ||
tzdata \ | ||
zstd \ | ||
icu-data-full \ | ||
$([ "$(apk --print-arch)" != 'ppc64le' ] && echo 'nss_wrapper') \ | ||
; \ | ||
wget -O pg_repack.zip http://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip \ | ||
&& unzip pg_repack.zip || true && rm -f pg_repack.zip \ | ||
&& cd pg_repack-${PG_REPACK_VERSION} \ | ||
&& make \ | ||
&& make install; \ | ||
apk del --no-network .build-deps; \ | ||
cd /; \ | ||
rm -rf \ | ||
/usr/src/postgresql \ | ||
/usr/local/share/doc \ | ||
/usr/local/share/man \ | ||
; \ | ||
\ | ||
pg_repack --version | ||
|
||
COPY docker_entrypoint.sh /bin/ | ||
|
||
ENTRYPOINT ["/bin/docker_entrypoint.sh"] | ||
CMD ["-no-superuser-check"] |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
ARG1=$1 | ||
|
||
case "${ARG1}" in | ||
"bash" | "sh" | "psql" | "pgbench" | "pg_dump" | "pg_dumpall") | ||
echo ${ARG1} | ||
exec "$@" | ||
;; | ||
*) | ||
exec /usr/local/bin/pg_repack "$@" | ||
;; | ||
esac |
Oops, something went wrong.