Skip to content

Commit be0f665

Browse files
author
Muhammad Aqeel
authored
[DISTPG-851] + [DISTPG-852] + [DISTPG-853] + [DISTPG-854] + [DISTPG-855]: PG ARM docker files. (percona#972)
1 parent f0b3861 commit be0f665

File tree

5 files changed

+567
-0
lines changed

5 files changed

+567
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
FROM oraclelinux:9
2+
3+
LABEL org.opencontainers.image.authors="info@percona.com"
4+
5+
RUN dnf -y update; \
6+
dnf -y install glibc-langpack-en
7+
8+
ENV PPG_VERSION 12.19-1
9+
ENV PPG_MAJOR_VERSION 12
10+
ENV PPG_MINOR_VERSION 19
11+
ENV OS_VER el9
12+
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
13+
ENV PPG_REPO testing
14+
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
15+
16+
# Do not report during Docker image creation.
17+
# Note that doing so, would create telemetry config file
18+
# which would prevent reporting when new container is started.
19+
# If we want to track Docker image creation as well,
20+
# remove telemetry config file after installing packages!
21+
ARG PERCONA_TELEMETRY_DISABLE=1
22+
23+
# check repository package signature in secure way
24+
RUN set -ex; \
25+
export GNUPGHOME="$(mktemp -d)"; \
26+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D; \
27+
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \
28+
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
29+
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
30+
dnf install -y findutils; \
31+
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
32+
rpmkeys --checksig /tmp/percona-release.rpm; \
33+
rpm -i /tmp/percona-release.rpm; \
34+
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
35+
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
36+
curl -Lf -o /tmp/percona-release https://raw.githubusercontent.com/percona/percona-repositories/release-1.0-28/scripts/percona-release.sh; \
37+
mv /tmp/percona-release /usr/bin/; \
38+
chmod +x /usr/bin/percona-release; \
39+
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};
40+
41+
RUN set -ex; \
42+
dnf -y update; \
43+
dnf -y install \
44+
bind-utils \
45+
gettext \
46+
hostname \
47+
perl \
48+
tar \
49+
bzip2 \
50+
lz4 \
51+
procps-ng; \
52+
dnf -y install \
53+
nss_wrapper \
54+
shadow-utils \
55+
libpq \
56+
libedit; \
57+
dnf clean all
58+
59+
# the numeric UID is needed for OpenShift
60+
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
61+
-c "Default Application User" postgres
62+
63+
RUN set -ex; \
64+
dnf install -y \
65+
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
66+
percona-postgresql${PPG_MAJOR_VERSION}-contrib-${FULL_PERCONA_VERSION} \
67+
percona-postgresql-common \
68+
percona-pg_stat_monitor${PPG_MAJOR_VERSION} \
69+
percona-pg_repack${PPG_MAJOR_VERSION} \
70+
percona-pgaudit${PPG_MAJOR_VERSION} \
71+
percona-pgaudit${PPG_MAJOR_VERSION}_set_user \
72+
percona-wal2json${PPG_MAJOR_VERSION}; \
73+
dnf clean all; \
74+
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db /docker-entrypoint-initdb.d; \
75+
chown -R 1001:0 /data/db docker-entrypoint-initdb.d
76+
77+
RUN set -ex; \
78+
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample; \
79+
grep -F "listen_addresses = '*'" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample
80+
81+
COPY LICENSE /licenses/LICENSE.Dockerfile
82+
RUN cp /usr/share/doc/percona-postgresql${PPG_MAJOR_VERSION}/COPYRIGHT /licenses/COPYRIGHT.PostgreSQL
83+
84+
ENV GOSU_VERSION=1.11
85+
RUN set -eux; \
86+
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64; \
87+
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc; \
88+
\
89+
export GNUPGHOME="$(mktemp -d)"; \
90+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
91+
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \
92+
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \
93+
\
94+
chmod +x /usr/bin/gosu; \
95+
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE
96+
97+
COPY entrypoint.sh /entrypoint.sh
98+
99+
ADD https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh /call-home.sh
100+
RUN chmod a+rx call-home.sh
101+
RUN mkdir -p /usr/local/percona
102+
RUN chown 1001:0 /usr/local/percona
103+
ENV CALL_HOME_OPTIONAL_PARAMS=" -s ${OS_VER}"
104+
105+
VOLUME ["/data/db"]
106+
107+
ENTRYPOINT ["/entrypoint.sh"]
108+
109+
EXPOSE 5432
110+
111+
USER 1001
112+
113+
CMD ["postgres"]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
FROM oraclelinux:9
2+
3+
LABEL org.opencontainers.image.authors="info@percona.com"
4+
5+
RUN dnf -y update; \
6+
dnf -y install glibc-langpack-en
7+
8+
ENV PPG_VERSION 13.15-1
9+
ENV PPG_MAJOR_VERSION 13
10+
ENV PPG_MINOR_VERSION 15
11+
ENV OS_VER el9
12+
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
13+
ENV PPG_REPO testing
14+
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
15+
16+
# Do not report during Docker image creation.
17+
# Note that doing so, would create telemetry config file
18+
# which would prevent reporting when new container is started.
19+
# If we want to track Docker image creation as well,
20+
# remove telemetry config file after installing packages!
21+
ARG PERCONA_TELEMETRY_DISABLE=1
22+
23+
# check repository package signature in secure way
24+
RUN set -ex; \
25+
export GNUPGHOME="$(mktemp -d)"; \
26+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D; \
27+
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \
28+
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
29+
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
30+
dnf install -y findutils; \
31+
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
32+
rpmkeys --checksig /tmp/percona-release.rpm; \
33+
rpm -i /tmp/percona-release.rpm; \
34+
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
35+
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
36+
curl -Lf -o /tmp/percona-release https://raw.githubusercontent.com/percona/percona-repositories/release-1.0-28/scripts/percona-release.sh; \
37+
mv /tmp/percona-release /usr/bin/; \
38+
chmod +x /usr/bin/percona-release; \
39+
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};
40+
41+
RUN set -ex; \
42+
dnf -y update; \
43+
dnf -y install \
44+
bind-utils \
45+
gettext \
46+
hostname \
47+
perl \
48+
tar \
49+
bzip2 \
50+
lz4 \
51+
procps-ng; \
52+
dnf -y install \
53+
nss_wrapper \
54+
shadow-utils \
55+
libpq \
56+
libedit; \
57+
dnf clean all
58+
59+
# the numeric UID is needed for OpenShift
60+
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
61+
-c "Default Application User" postgres
62+
63+
RUN set -ex; \
64+
dnf install -y \
65+
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
66+
percona-postgresql${PPG_MAJOR_VERSION}-contrib-${FULL_PERCONA_VERSION} \
67+
percona-postgresql-common \
68+
percona-pg_stat_monitor${PPG_MAJOR_VERSION} \
69+
percona-pg_repack${PPG_MAJOR_VERSION} \
70+
percona-pgaudit${PPG_MAJOR_VERSION} \
71+
percona-pgaudit${PPG_MAJOR_VERSION}_set_user \
72+
percona-wal2json${PPG_MAJOR_VERSION}; \
73+
dnf clean all; \
74+
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db /docker-entrypoint-initdb.d; \
75+
chown -R 1001:0 /data/db docker-entrypoint-initdb.d
76+
77+
RUN set -ex; \
78+
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample; \
79+
grep -F "listen_addresses = '*'" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample
80+
81+
COPY LICENSE /licenses/LICENSE.Dockerfile
82+
RUN cp /usr/share/doc/percona-postgresql${PPG_MAJOR_VERSION}/COPYRIGHT /licenses/COPYRIGHT.PostgreSQL
83+
84+
ENV GOSU_VERSION=1.11
85+
RUN set -eux; \
86+
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64; \
87+
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc; \
88+
\
89+
export GNUPGHOME="$(mktemp -d)"; \
90+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
91+
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \
92+
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \
93+
\
94+
chmod +x /usr/bin/gosu; \
95+
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE
96+
97+
COPY entrypoint.sh /entrypoint.sh
98+
99+
ADD https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh /call-home.sh
100+
RUN chmod a+rx call-home.sh
101+
RUN mkdir -p /usr/local/percona
102+
RUN chown 1001:0 /usr/local/percona
103+
ENV CALL_HOME_OPTIONAL_PARAMS=" -s ${OS_VER}"
104+
105+
VOLUME ["/data/db"]
106+
107+
ENTRYPOINT ["/entrypoint.sh"]
108+
109+
EXPOSE 5432
110+
111+
USER 1001
112+
113+
CMD ["postgres"]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
FROM oraclelinux:9
2+
3+
LABEL org.opencontainers.image.authors="info@percona.com"
4+
5+
RUN dnf -y update; \
6+
dnf -y install glibc-langpack-en
7+
8+
ENV PPG_VERSION 14.12-1
9+
ENV PPG_MAJOR_VERSION 14
10+
ENV PPG_MINOR_VERSION 12
11+
ENV OS_VER el9
12+
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
13+
ENV PPG_REPO testing
14+
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
15+
16+
# Do not report during Docker image creation.
17+
# Note that doing so, would create telemetry config file
18+
# which would prevent reporting when new container is started.
19+
# If we want to track Docker image creation as well,
20+
# remove telemetry config file after installing packages!
21+
ARG PERCONA_TELEMETRY_DISABLE=1
22+
23+
# check repository package signature in secure way
24+
RUN set -ex; \
25+
export GNUPGHOME="$(mktemp -d)"; \
26+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D; \
27+
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \
28+
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
29+
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
30+
dnf install -y findutils; \
31+
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
32+
rpmkeys --checksig /tmp/percona-release.rpm; \
33+
rpm -i /tmp/percona-release.rpm; \
34+
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
35+
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
36+
curl -Lf -o /tmp/percona-release https://raw.githubusercontent.com/percona/percona-repositories/release-1.0-28/scripts/percona-release.sh; \
37+
mv /tmp/percona-release /usr/bin/; \
38+
chmod +x /usr/bin/percona-release; \
39+
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};
40+
41+
RUN set -ex; \
42+
dnf -y update; \
43+
dnf -y install \
44+
bind-utils \
45+
gettext \
46+
hostname \
47+
perl \
48+
tar \
49+
bzip2 \
50+
lz4 \
51+
procps-ng; \
52+
dnf -y install \
53+
nss_wrapper \
54+
shadow-utils \
55+
libpq \
56+
libedit; \
57+
dnf clean all
58+
59+
# the numeric UID is needed for OpenShift
60+
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
61+
-c "Default Application User" postgres
62+
63+
RUN set -ex; \
64+
dnf install -y \
65+
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
66+
percona-postgresql${PPG_MAJOR_VERSION}-contrib-${FULL_PERCONA_VERSION} \
67+
percona-postgresql-common \
68+
percona-pg_stat_monitor${PPG_MAJOR_VERSION} \
69+
percona-pg_repack${PPG_MAJOR_VERSION} \
70+
percona-pgaudit${PPG_MAJOR_VERSION} \
71+
percona-pgaudit${PPG_MAJOR_VERSION}_set_user \
72+
percona-wal2json${PPG_MAJOR_VERSION}; \
73+
dnf clean all; \
74+
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db /docker-entrypoint-initdb.d; \
75+
chown -R 1001:0 /data/db docker-entrypoint-initdb.d
76+
77+
RUN set -ex; \
78+
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample; \
79+
grep -F "listen_addresses = '*'" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample
80+
81+
COPY LICENSE /licenses/LICENSE.Dockerfile
82+
RUN cp /usr/share/doc/percona-postgresql${PPG_MAJOR_VERSION}/COPYRIGHT /licenses/COPYRIGHT.PostgreSQL
83+
84+
ENV GOSU_VERSION=1.11
85+
RUN set -eux; \
86+
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64; \
87+
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc; \
88+
\
89+
export GNUPGHOME="$(mktemp -d)"; \
90+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
91+
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \
92+
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \
93+
\
94+
chmod +x /usr/bin/gosu; \
95+
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE
96+
97+
COPY entrypoint.sh /entrypoint.sh
98+
99+
ADD https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh /call-home.sh
100+
RUN chmod a+rx call-home.sh
101+
RUN mkdir -p /usr/local/percona
102+
RUN chown 1001:0 /usr/local/percona
103+
ENV CALL_HOME_OPTIONAL_PARAMS=" -s ${OS_VER}"
104+
105+
VOLUME ["/data/db"]
106+
107+
ENTRYPOINT ["/entrypoint.sh"]
108+
109+
EXPOSE 5432
110+
111+
USER 1001
112+
113+
CMD ["postgres"]

0 commit comments

Comments
 (0)