update
This commit is contained in:
58
pgsql/Dockerfile
Normal file
58
pgsql/Dockerfile
Normal file
@@ -0,0 +1,58 @@
|
||||
ARG ARCH
|
||||
FROM harbor.colben.cn/general/rocky$ARCH:8
|
||||
MAINTAINER Colben colbenlee@gmail.com
|
||||
ARG ARCH
|
||||
ARG VERSION
|
||||
ADD --chown=root:root /ADD/ /opt/
|
||||
RUN echo -e "[pgdg-common]\n\
|
||||
name=PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux \$releasever - \$basearch\n\
|
||||
baseurl=https://mirrors.tuna.tsinghua.edu.cn/postgresql/repos/yum/common/redhat/rhel-\$releasever-\$basearch\n\
|
||||
enabled=1\n\
|
||||
gpgcheck=0\n\
|
||||
gpgkey=file:///etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL\n\
|
||||
repo_gpgcheck = 0\n\
|
||||
\n\
|
||||
[pgdg$VERSION]\n\
|
||||
name=PostgreSQL $VERSION for RHEL / Rocky / AlmaLinux \$releasever - \$basearch\n\
|
||||
baseurl=https://mirrors.tuna.tsinghua.edu.cn/postgresql/repos/yum/$VERSION/redhat/rhel-\$releasever-\$basearch\n\
|
||||
enabled=1\n\
|
||||
gpgcheck=0\n\
|
||||
gpgkey=file:///etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL\n\
|
||||
repo_gpgcheck = 0\n\
|
||||
" > /etc/yum.repos.d/pgsql-$VERSION.repo \
|
||||
&& dnf makecache \
|
||||
&& dnf -y module disable postgresql \
|
||||
&& dnf install -y postgresql$VERSION-server \
|
||||
&& rm -rf /var/lib/pgsql/* \
|
||||
/var/cache/dnf \
|
||||
/var/lib/dnf \
|
||||
/var/log/* \
|
||||
&& rm -f /var/lib/pgsql/.bash* \
|
||||
&& mkdir -p /var/log/pgsql /etc/pgsql/conf.d \
|
||||
&& chown -R postgres:postgres /var/log/pgsql \
|
||||
&& echo -e "# DO NOT EDIT THIS FILE!\n\
|
||||
\n\
|
||||
include_if_exists = '/var/lib/pgsql/postgresql.conf'\n\
|
||||
include_dir = 'conf.d'\n\
|
||||
include = 'fixed-parameters.conf'\n\
|
||||
" > /etc/pgsql/postgresql.conf \
|
||||
&& echo -e "# DO NOT EDIT THIS FILE!\n\
|
||||
\n\
|
||||
data_directory = '/var/lib/pgsql'\n\
|
||||
hba_file = '/var/lib/pgsql/pg_hba.conf'\n\
|
||||
ident_file = '/var/lib/pgsql/pg_ident.conf'\n\
|
||||
log_destination = 'stderr'\n\
|
||||
logging_collector = on\n\
|
||||
log_directory = '/var/log/pgsql'\n\
|
||||
log_filename = 'server-%y%m%d.log'\n\
|
||||
log_file_mode = 0644\n\
|
||||
log_rotation_age = 1d\n\
|
||||
log_rotation_size = 128MB\n\
|
||||
log_truncate_on_rotation = on\n\
|
||||
" > /etc/pgsql/fixed-parameters.conf \
|
||||
&& echo -e "export PGDATA=/etc/pgsql\n\
|
||||
export PATH=/usr/pgsql-$VERSION/bin:\$PATH\n\
|
||||
" > /etc/profile.d/pgsql.sh
|
||||
ENV VERSION=15
|
||||
CMD ["/opt/ccmd"]
|
||||
|
Reference in New Issue
Block a user