Skip to content

Commit d3f6bd2

Browse files
committed
Add installation of postgresml-python and fix many issues.
1 parent 47300ab commit d3f6bd2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+469
-1279
lines changed

.github/workflows/docker-image.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
name: Docker Image CI
2-
32
on:
43
push:
54
branches: [ "main" ]
65
pull_request:
76
branches: [ "main" ]
8-
97
jobs:
108
free-disk-space:
119
runs-on: ubuntu-latest
1210
steps:
13-
1411
- name: Free Disk Space (Ubuntu)
1512
uses: jlumbroso/free-disk-space@main
1613
with:
@@ -21,19 +18,15 @@ jobs:
2118
large-packages: true
2219
docker-images: true
2320
swap-storage: true
24-
2521
build:
2622
if: ${{ always() }}
2723
needs: free-disk-space
2824
runs-on: ubuntu-latest
2925
steps:
30-
3126
- name: Checkout
3227
uses: actions/checkout@v4
33-
3428
- name: Set up QEMU
3529
uses: docker/setup-qemu-action@v3
36-
3730
- name: Set up Docker Buildx
3831
uses: docker/setup-buildx-action@v3
3932

@@ -49,7 +42,6 @@ jobs:
4942
# registry: ghcr.io
5043
# username: ${{ github.repository_owner }}
5144
# password: ${{ secrets.GITHUB_TOKEN }}
52-
5345
# - name: Login to c8n.io Harbor Container Registry
5446
# uses: docker/login-action@v3
5547
# with:
@@ -72,7 +64,6 @@ jobs:
7264
tags: |
7365
alvsoft/postgres:16
7466
alvsoft/postgres:latest
75-
7667
# c8n.io/lucatchomba/postgres:16
7768
# c8n.io/lucatchomba/postgres:latest
7869
# ghcr.io/alvsoft/postgres:latest

Dockerfile.back

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ ARG CGAL_GIT_BRANCH=5.6.x-branch
44
FROM postgres:${PG_MAJOR_VERSION} AS builder
55
ARG PG_MAJOR_VERSION
66
ARG DOCKER_CMAKE_BUILD_TYPE
7-
87
LABEL maintainer="TKamitaSoft Service - https://tkamitasoft.com" \
98
org.opencontainers.image.description="TKamitaSoft PostgrSQL database" \
109
org.opencontainers.image.source="https://gitlab.com/tkamitasoft/apps/host"
11-
1210
WORKDIR /
13-
1411
# apt-get install
1512
RUN set -ex \
1613
&& apt-get update -y \
@@ -76,9 +73,7 @@ RUN set -ex \
7673
libqhull-dev \
7774
libwebp-dev \
7875
libzstd-dev
79-
8076
ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE}
81-
8277
# cgal & sfcgal
8378
# By utilizing the latest commit of the CGAL 5.x.x-branch and implementing a header-only build for SFCGAL,
8479
# one can benefit from the latest CGAL patches while avoiding compatibility issues.
@@ -116,7 +111,6 @@ RUN set -ex \
116111
# clean
117112
&& rm -fr /usr/src/SFCGAL \
118113
&& rm -fr /usr/src/cgal
119-
120114
# proj
121115
ENV PROJ_GIT_HASH=356496f7b60ee0235189dd51d99aac700fbd2bdc
122116
RUN set -ex \
@@ -146,7 +140,6 @@ RUN set -ex \
146140
fi \
147141
\
148142
&& rm -fr /usr/src/PROJ
149-
150143
# geos
151144
ENV GEOS_GIT_HASH=a8d2ed0aba46f88f9b8987526e68eea6565d16ae
152145
RUN set -ex \
@@ -162,7 +155,6 @@ RUN set -ex \
162155
&& make install \
163156
&& cd / \
164157
&& rm -fr /usr/src/geos
165-
166158
# gdal
167159
ENV GDAL_GIT_HASH=d7aed6e0b03f949ba40684f868c63a08d89177b1
168160
RUN set -ex \
@@ -232,7 +224,6 @@ RUN set -ex \
232224
&& make install \
233225
&& cd / \
234226
&& rm -fr /usr/src/gdal
235-
236227
# Minimal command line test.
237228
RUN set -ex \
238229
&& ldconfig \
@@ -244,15 +235,12 @@ RUN set -ex \
244235
&& proj \
245236
&& sfcgal-config --version \
246237
&& pcre-config --version
247-
248238
# -------------------------------------------
249239
# STAGE final
250240
# -------------------------------------------
251241
FROM postgres:${PG_MAJOR_VERSION}
252-
253242
ARG DOCKER_CMAKE_BUILD_TYPE
254243
ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE}
255-
256244
RUN set -ex \&& apt-get update -y \
257245
&& apt-get install -y --no-install-recommends \
258246
curl \
@@ -290,18 +278,15 @@ RUN set -ex \&& apt-get update -y \
290278
libqhull-r8.0 \
291279
&& apt-get clean -y \
292280
&& rm -rf /var/lib/apt/lists/*
293-
294281
COPY --from=builder /_pgis*.* /
295282
COPY --from=builder /usr/local /usr/local
296-
297283
ARG CGAL_GIT_BRANCH
298284
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
299285
ENV CGAL5X_GIT_HASH=188e51bad36ffc30e49dbabda29620b71a84664c
300286
ENV SFCGAL_GIT_HASH=61f3b08ade49493b56c6bafa98c7c1f84addbc10
301287
ENV PROJ_GIT_HASH=356496f7b60ee0235189dd51d99aac700fbd2bdc
302288
ENV GEOS_GIT_HASH=a8d2ed0aba46f88f9b8987526e68eea6565d16ae
303289
ENV GDAL_GIT_HASH=d7aed6e0b03f949ba40684f868c63a08d89177b1
304-
305290
# Minimal command line test ( fail fast )
306291
RUN set -ex \
307292
&& ldconfig \
@@ -317,15 +302,13 @@ RUN set -ex \
317302
# Testing ogr2ogr PostgreSQL driver.
318303
&& ogr2ogr --formats | grep -q "PostgreSQL/PostGIS" && exit 0 \
319304
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1
320-
321305
# install postgis, pgvector, pgmq, pg_partman, potgresml, pgcat, patroni, pgcopydb
322306
ENV POSTGIS_GIT_HASH=8ed84517a9b86c86724504d1b6a0f0c1ccd86cf6
323307
ENV PGVECTOR_GIT_HASH=v0.7.2
324308
ENV PGMQ_GIT_HASH=v1.3.3
325309
ENV PGPARTMAN_GIT_HASH=v5.1.0
326310
ENV TZ=UTC
327311
ENV DEBIAN_FRONTEND=noninteractive
328-
329312
RUN set -ex \
330313
&& export DEBIAN_FRONTEND=noninteractive \
331314
&& apt-get update -y \
@@ -506,19 +489,15 @@ RUN set -ex \
506489
xsltproc \
507490
&& apt-get clean -y \
508491
&& rm -rf /var/lib/apt/lists/* /root/.cache
509-
510492
RUN mkdir -p /docker-entrypoint-initdb.d
511493
COPY ./postgis/initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
512494
COPY ./postgis/update-postgis.sh /usr/local/bin
513-
514495
COPY ./patroni/entrypoint.sh /
515-
516496
EXPOSE 5432 8008
517497
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 EDITOR=/usr/bin/editor
518498
USER postgres
519499
WORKDIR /home/postgres
520500
CMD ["/bin/bash", "/entrypoint.sh"]
521-
522501
# last final test
523502
RUN set -ex \
524503
&& ldconfig \

Dockerfile.citus

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ ARG PGHOME=/home/postgres
66
ARG PGDATA=$PGHOME/data
77
ARG LC_ALL=C.UTF-8
88
ARG LANG=C.UTF-8
9-
109
FROM postgres:$PG_MAJOR as builder
11-
1210
ARG PGHOME
1311
ARG PGDATA
1412
ARG LC_ALL
1513
ARG LANG
16-
1714
ENV ETCDVERSION=3.3.13 CONFDVERSION=0.16.0
18-
1915
RUN set -ex \
2016
&& export DEBIAN_FRONTEND=noninteractive \
2117
&& echo 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend \
@@ -121,7 +117,6 @@ RUN set -ex \
121117
&& find /var/log -type f -exec truncate --size 0 {} \; \
122118
&& find /usr/lib/python3/dist-packages -name '*test*' | xargs rm -fr \
123119
&& find /lib/$(uname -m)-linux-gnu/security -type f ! -name pam_env.so ! -name pam_permit.so ! -name pam_unix.so -delete
124-
125120
# perform compression if it is necessary
126121
ARG COMPRESS
127122
RUN if [ "$COMPRESS" = "true" ]; then \
@@ -147,33 +142,25 @@ RUN if [ "$COMPRESS" = "true" ]; then \
147142
else \
148143
/bin/busybox --install -s; \
149144
fi
150-
151145
FROM scratch
152146
COPY --from=builder / /
153-
154147
LABEL maintainer="Alexander Kukushkin <[email protected]>"
155-
156148
ARG PG_MAJOR
157149
ARG COMPRESS
158150
ARG PGHOME
159151
ARG PGDATA
160152
ARG LC_ALL
161153
ARG LANG
162-
163154
ARG PGBIN=/usr/lib/postgresql/$PG_MAJOR/bin
164-
165155
ENV LC_ALL=$LC_ALL LANG=$LANG EDITOR=/usr/bin/editor
166156
ENV PGDATA=$PGDATA PATH=$PATH:$PGBIN
167157
ENV ETCDCTL_API=3
168-
169158
COPY patroni /patroni/
170159
COPY extras/confd/conf.d/haproxy.toml /etc/confd/conf.d/
171160
COPY extras/confd/templates/haproxy-citus.tmpl /etc/confd/templates/haproxy.tmpl
172161
COPY patroni*.py docker/entrypoint.sh /
173162
COPY postgres?.yml $PGHOME/
174-
175163
WORKDIR $PGHOME
176-
177164
RUN sed -i 's/env python/&3/' /patroni*.py \
178165
# "fix" patroni configs
179166
&& sed -i 's/^ listen: 127.0.0.1/ listen: 0.0.0.0/' postgres?.yml \
@@ -195,7 +182,5 @@ RUN sed -i 's/env python/&3/' /patroni*.py \
195182
&& if [ "$COMPRESS" = "true" ]; then chmod u+s /usr/bin/sudo; fi \
196183
&& chmod +s /bin/ping \
197184
&& chown -R postgres:postgres $PGHOME /run /etc/haproxy
198-
199185
USER postgres
200-
201186
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

Dockerfile2.back

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
ARG PG_MAJOR_VERSION=16
22
ARG DEBIAN_FRONTEND=noninteractive
33
ARG PARADEDB_TELEMETRY=false
4-
54
FROM postgres:${PG_MAJOR_VERSION}
6-
75
ARG DEBIAN_FRONTEND
86
ARG PARADEDB_TELEMETRY
97
ENV PARADEDB_TELEMETRY=$PARADEDB_TELEMETRY
108
ENV TZ=UTC
11-
129
LABEL maintainer="ATCHOMBA Luc Vindjedou - https://www.alvsoft.pro" \
1310
org.opencontainers.image.description="PostgrSQL Server with many extention installed." \
1411
org.opencontainers.image.source="https://github.com/alvsoft/postgres"
15-
1612
RUN apt-get update && \
1713
apt-get install -y --no-install-recommends \
1814
ca-certificates \
1915
curl \
2016
pgcopydb \
2117
patroni \
2218
check-patroni
23-
2419
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
2520
SHELL [ "/bin/sh", "-s", ".", "$HOME/.cargo/env" ]
2621
RUN cargo install pg-trunk
@@ -40,6 +35,5 @@ RUN apt-get purge -y curl && \
4035
apt-get autoremove -y && \
4136
apt-get clean -y && \
4237
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
43-
4438
USER postgres
4539
CMD ["postgres"]

Dockerfile3.back

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ ARG PGHOME=/home/postgres
66
ARG PGDATA=$PGHOME/data
77
ARG LC_ALL=C.UTF-8
88
ARG LANG=C.UTF-8
9-
109
FROM postgres:$PG_MAJOR as builder
11-
1210
ARG PGHOME
1311
ARG PGDATA
1412
ARG LC_ALL
1513
ARG LANG
1614
ARG ETCD_VER=v3.5.15
1715
ARG PATRONI_VER=v3.3.2
18-
1916
RUN set -ex \
2017
&& export DEBIAN_FRONTEND=noninteractive \
2118
&& echo 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend \
@@ -95,7 +92,6 @@ RUN set -ex \
9592
&& find /var/log -type f -exec truncate --size 0 {} \; \
9693
&& find /usr/lib/python3/dist-packages -name '*test*' | xargs rm -fr \
9794
&& find /lib/$(uname -m)-linux-gnu/security -type f ! -name pam_env.so ! -name pam_permit.so ! -name pam_unix.so -delete
98-
9995
# perform compression if it is necessary
10096
ARG COMPRESS
10197
RUN if [ "$COMPRESS" = "true" ]; then \
@@ -121,35 +117,27 @@ RUN if [ "$COMPRESS" = "true" ]; then \
121117
else \
122118
/bin/busybox --install -s; \
123119
fi
124-
125120
FROM scratch
126121
COPY --from=builder / /
127-
128122
LABEL maintainer="ATCHOMBA Luc Vindjedou - <https://www.alvsoft.pro>" \
129123
org.opencontainers.image.description="PostgrSQL Server with many extention installed." \
130124
org.opencontainers.image.source="https://github.com/alvsoft/postgres"
131-
132125
ARG PG_MAJOR
133126
ARG COMPRESS
134127
ARG PGHOME
135128
ARG PGDATA
136129
ARG LC_ALL
137130
ARG LANG
138-
139131
ARG PGBIN=/usr/lib/postgresql/$PG_MAJOR/bin
140-
141132
ENV LC_ALL=$LC_ALL LANG=$LANG EDITOR=/usr/bin/editor
142133
ENV PGDATA=$PGDATA PATH=$PATH:$PGBIN
143134
ENV ETCDCTL_API=3
144-
145135
COPY --from=builder /usr/src/patroni/patroni /patroni/
146136
COPY --from=builder /usr/src/patroni/extras/confd/conf.d/haproxy.toml /etc/confd/conf.d/
147137
COPY --from=builder /usr/src/patroni/extras/confd/templates/haproxy.tmpl /etc/confd/templates/
148138
COPY patroni*.py docker/entrypoint.sh /
149139
COPY postgres?.yml $PGHOME/
150-
151140
WORKDIR $PGHOME
152-
153141
RUN rm -rf /usr/src/patroni \
154142
&& sed -i 's/env python/&3/' /patroni*.py \
155143
# "fix" patroni configs
@@ -165,7 +153,5 @@ RUN rm -rf /usr/src/patroni \
165153
&& if [ "$COMPRESS" = "true" ]; then chmod u+s /usr/bin/sudo; fi \
166154
&& chmod +s /bin/ping \
167155
&& chown -R postgres:postgres "$PGHOME" /run /etc/haproxy
168-
169156
USER postgres
170-
171157
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

LICENSE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
MIT License
2-
32
Copyright (c) 2024 ATCHOMBA Vindjedou
4-
53
Permission is hereby granted, free of charge, to any person obtaining a copy
64
of this software and associated documentation files (the "Software"), to deal
75
in the Software without restriction, including without limitation the rights
86
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
97
copies of the Software, and to permit persons to whom the Software is
108
furnished to do so, subject to the following conditions:
11-
129
The above copyright notice and this permission notice shall be included in all
1310
copies or substantial portions of the Software.
14-
1511
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1612
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1713
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

0 commit comments

Comments
 (0)