forked from CircleCI-Public/cimg-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.template
94 lines (82 loc) · 2.32 KB
/
Dockerfile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# vim:set ft=dockerfile:
# 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.
FROM cimg/%%PARENT%%:2022.08
LABEL maintainer="Community & Partner Engineering Team <[email protected]>"
ENV PG_VER=%%VERSION_FULL%%
ENV PG_MAJOR=%%VERSION_MAJOR%%
ENV POSTGRES_HOST_AUTH_METHOD=trust
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
dirmngr \
gnupg \
gosu \
libclang-dev \
libicu-dev \
libipc-run-perl \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
libpam-dev \
libperl-dev \
libpython3-dev \
libreadline-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
llvm \
llvm-dev \
locales \
python3-dev \
tcl-dev \
uuid-dev \
&& \
rm -rf /var/lib/apt/lists/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
curl -sSL "https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz" | tar -xz && \
cd postgresql-${PG_VER} && \
./configure \
--prefix=/usr/lib/postgresql/$PG_MAJOR \
--enable-integer-datetimes \
--enable-thread-safety \
--enable-tap-tests \
--with-uuid=e2fs \
--with-gnu-ld \
--with-pgport=5432 \
--with-system-tzdata=/usr/share/zoneinfo \
--with-includes=/usr/local/include \
--with-libraries=/usr/local/lib \
--with-krb5 \
--with-gssapi \
--with-ldap \
--with-pam \
--with-tcl \
--with-perl \
--with-python \
--with-openssl \
--with-libxml \
--with-libxslt \
--with-icu \
--with-llvm \
--with-lz4 \
&& \
# we can change from world to world-bin in newer releases
make world && \
make install-world
RUN mkdir /docker-entrypoint-initdb.d
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN useradd postgres -m -s /bin/bash && \
groupadd --force postgres && \
adduser postgres postgres
ENV POSTGRES_DB=circle_test
COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN mkdir -p /var/lib/postgresql && \
chown -R postgres:postgres /var/lib/postgresql && \
chown -R postgres:postgres /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
STOPSIGNAL SIGINT
EXPOSE 5432
CMD ["postgres"]