Skip to content

Commit 8189138

Browse files
committed
Merge branch '200-extended-image-with-walg' into 'master'
feat: get rid of the sync-instance image (database-lab#200): * add renewed WAL-G to the extended image * remove the sync-instance image * add flexible PGDATA definition See merge request postgres-ai/custom-images!23
2 parents 1e5beef + a00b039 commit 8189138

File tree

5 files changed

+16
-156
lines changed

5 files changed

+16
-156
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ stages:
33

44
include:
55
- local: '/extended/build-images-ci.yml'
6-
- local: '/sync-instance/build-images-ci.yml'

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ The PostgreSQL 13 image is now missing the following extensions (they will be ad
113113
| uuid-ossp | 1.1 | generate universally unique identifiers (UUIDs) |
114114
| xml2 | 1.1 | XPath querying and XSLT |
115115

116+
### PostgreSQL Tools:
117+
- [WAL-G](https://github.com/wal-g/wal-g)
118+
116119
## Sync Instance images
120+
121+
**Deprecated. Use the extended image instead.**
122+
117123
PostgreSQL Docker images with WAL-G.
118124

119125
Available versions: 9.6, 10, 11, 12, and 13.

extended/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ LABEL maintainer="postgres.ai"
66
ARG PG_SERVER_VERSION
77
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12}
88

9+
ARG WALG_VERSION
10+
ENV WALG_VERSION=${WALG_VERSION:-0.2.19}
11+
912
ENV CITUS_VERSION=9.4
1013

1114
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
@@ -17,9 +20,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
1720
postgresql-server-dev-${PG_SERVER_VERSION} \
1821
&& apt-get install --no-install-recommends -y \
1922
postgresql-${PG_SERVER_VERSION}-repack \
20-
&& apt-get install --no-install-recommends -y \
23+
&& apt-get install --no-install-recommends -y \
2124
postgresql-plpython3-${PG_SERVER_VERSION} \
22-
# extensions supported in PostgreSQL 12 and below
25+
# extensions supported in PostgreSQL 12 and below
2326
# bc is used to manage PostgreSQL versions with dot like 9.6
2427
&& if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
2528
# hypopg
@@ -81,6 +84,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
8184
# set_user extension
8285
&& git clone https://github.com/pgaudit/set_user.git \
8386
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \
87+
# WAL-G
88+
&& wget --quiet -O /tmp/wal-g.linux-amd64.tar.gz "https://github.com/wal-g/wal-g/releases/download/v${WALG_VERSION}/wal-g.linux-amd64.tar.gz" \
89+
&& tar -zxvf /tmp/wal-g.linux-amd64.tar.gz && mv wal-g /usr/local/bin/ \
8490
# remove all auxilary packages to reduce final image size
8591
&& cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove gcc \
8692
make wget unzip curl libc6-dev apt-transport-https git \
@@ -96,9 +102,9 @@ EXPOSE 5432
96102

97103
# Prepare Postgres start script
98104
RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \
99-
&& echo "chown -R postgres:postgres /var/lib/postgresql/pgdata /var/run/postgresql" \
105+
&& echo "chown -R postgres:postgres \${PGDATA} /var/run/postgresql" \
100106
>> /pg_start.sh \
101-
&& printf "sudo -u postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D /var/lib/postgresql/pgdata \n" \
107+
&& printf "sudo -Eu postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \
102108
>> /pg_start.sh \
103109
# Infinite sleep to allow restarting Postgres
104110
&& echo "/bin/bash -c \"trap : TERM INT; sleep infinity & wait\"" \

sync-instance/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

sync-instance/build-images-ci.yml

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)