Skip to content

Commit 68e5a85

Browse files
committed
Pre-tune PostgreSQL for CircleCI & test with 15.2 [release]
1 parent 03ef53c commit 68e5a85

File tree

7 files changed

+133
-13
lines changed

7 files changed

+133
-13
lines changed

15.2/Dockerfile

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# vim:set ft=dockerfile:
2+
3+
# Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles.
4+
5+
# By policy, the base image tag should be a quarterly tag unless there's a
6+
# specific reason to use a different one. This means January, April, July, or
7+
# October.
8+
# Using November right now to include OpenSSL CVE fixes.
9+
FROM cimg/base:2022.11
10+
11+
LABEL maintainer="Community & Partner Engineering Team <[email protected]>"
12+
13+
ENV PG_VER=15.2
14+
ENV PG_MAJOR=15
15+
ENV POSTGRES_HOST_AUTH_METHOD=trust
16+
17+
USER root
18+
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
clang \
20+
dirmngr \
21+
gnupg \
22+
gosu \
23+
libclang-dev \
24+
libicu-dev \
25+
libipc-run-perl \
26+
libkrb5-dev \
27+
libldap2-dev \
28+
liblz4-dev \
29+
libpam-dev \
30+
libperl-dev \
31+
libpython3-dev \
32+
libreadline-dev \
33+
libssl-dev \
34+
libxml2-dev \
35+
libxslt1-dev \
36+
llvm \
37+
llvm-dev \
38+
locales \
39+
python3-dev \
40+
tcl-dev \
41+
uuid-dev \
42+
&& \
43+
rm -rf /var/lib/apt/lists/* && \
44+
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
45+
curl -sSL "https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz" | tar -xz && \
46+
cd postgresql-${PG_VER} && \
47+
./configure \
48+
--prefix=/usr/lib/postgresql/$PG_MAJOR \
49+
--enable-integer-datetimes \
50+
--enable-thread-safety \
51+
--enable-tap-tests \
52+
--with-uuid=e2fs \
53+
--with-gnu-ld \
54+
--with-pgport=5432 \
55+
--with-system-tzdata=/usr/share/zoneinfo \
56+
--with-includes=/usr/local/include \
57+
--with-libraries=/usr/local/lib \
58+
--with-krb5 \
59+
--with-gssapi \
60+
--with-ldap \
61+
--with-pam \
62+
--with-tcl \
63+
--with-perl \
64+
--with-python \
65+
--with-openssl \
66+
--with-libxml \
67+
--with-libxslt \
68+
--with-icu \
69+
--with-llvm \
70+
--with-lz4 \
71+
&& \
72+
# we can change from world to world-bin in newer releases
73+
make world && \
74+
make install-world
75+
76+
RUN mkdir /docker-entrypoint-initdb.d
77+
78+
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
79+
ENV PGDATA /var/lib/postgresql/data
80+
81+
RUN useradd postgres -m -s /bin/bash && \
82+
groupadd --force postgres && \
83+
adduser postgres postgres
84+
85+
ENV POSTGRES_DB=circle_test
86+
87+
COPY postgresql.conf /etc/postgresql/postgresql.conf
88+
COPY docker-entrypoint.sh /usr/local/bin/
89+
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
90+
91+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
92+
RUN mkdir -p /var/lib/postgresql && \
93+
chown -R postgres:postgres /var/lib/postgresql && \
94+
chown -R postgres:postgres /usr/local/bin/docker-entrypoint.sh
95+
96+
ENTRYPOINT ["docker-entrypoint.sh"]
97+
STOPSIGNAL SIGINT
98+
EXPOSE 5432
99+
CMD ["postgres"]

15.2/postgis/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# vim:set ft=dockerfile:
2+
3+
FROM cimg/postgres:15.2
4+
5+
LABEL maintainer="Community & Partner Engineering Team <[email protected]>"
6+
7+
ENV POSTGIS_VER=3.2.4
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
libgdal-dev \
10+
libgeos-dev \
11+
libjson-c-dev \
12+
libmysqlclient-dev \
13+
libproj-dev \
14+
libprotobuf-c-dev \
15+
libxml2-dev \
16+
protobuf-c-compiler \
17+
&& \
18+
rm -rf /var/lib/apt/lists/* && \
19+
curl -sSL "https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VER}.tar.gz" | tar -xz && \
20+
cd postgis-${POSTGIS_VER} && \
21+
./configure && \
22+
make && \
23+
make install

Dockerfile.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ RUN useradd postgres -m -s /bin/bash && \
8484

8585
ENV POSTGRES_DB=circle_test
8686

87+
COPY postgresql.conf /etc/postgresql/postgresql.conf
8788
COPY docker-entrypoint.sh /usr/local/bin/
8889
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
8990

GEN-CHECK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
GEN_CHECK=(13.9 14.6 15.1)
1+
GEN_CHECK=(15.2)

build-images.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/usr/bin/env bash
22
# Do not edit by hand; please use build scripts/templates to make changes
33

4-
docker build --file 13.9/Dockerfile -t cimg/postgres:13.9 -t cimg/postgres:13.9 .
5-
docker build --file 13.9/postgis/Dockerfile -t cimg/postgres:13.9-postgis -t cimg/postgres:13.9-postgis .
6-
docker build --file 14.6/Dockerfile -t cimg/postgres:14.6 -t cimg/postgres:14.6 .
7-
docker build --file 14.6/postgis/Dockerfile -t cimg/postgres:14.6-postgis -t cimg/postgres:14.6-postgis .
8-
docker build --file 15.1/Dockerfile -t cimg/postgres:15.1 -t cimg/postgres:15.1 .
9-
docker build --file 15.1/postgis/Dockerfile -t cimg/postgres:15.1-postgis -t cimg/postgres:15.1-postgis .
4+
docker build --file 15.2/Dockerfile -t cimg/postgres:15.2 -t cimg/postgres:15.2 .
5+
docker build --file 15.2/postgis/Dockerfile -t cimg/postgres:15.2-postgis -t cimg/postgres:15.2-postgis .

postgresql.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
shared_buffers = 512MB
2+
max_connections = 200
3+
max_prepared_transactions = 200
4+
max_locks_per_transaction = 512
5+
max_pred_locks_per_transaction = 256

push-images.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
#!/usr/bin/env bash
22
# Do not edit by hand; please use build scripts/templates to make changes
3-
docker push cimg/postgres:13.9
4-
docker push cimg/postgres:13.9-postgis
5-
docker push cimg/postgres:14.6
6-
docker push cimg/postgres:14.6-postgis
7-
docker push cimg/postgres:15.1
8-
docker push cimg/postgres:15.1-postgis
3+
docker push cimg/postgres:15.2
4+
docker push cimg/postgres:15.2-postgis

0 commit comments

Comments
 (0)