1
- # PostgreSQL Container Images
1
+ > ** IMPORTANT:** As of January 2025, we have transitioned to a new image build
2
+ > process (see issue [ #132 ] ( https://github.com/cloudnative-pg/postgres-containers/issues/132 )
3
+ > for details). Previously, the images were based on the
4
+ > [ Official Postgres image] ( https://hub.docker.com/_/postgres ) , maintained by the
5
+ > [ PostgreSQL Docker Community] ( https://github.com/docker-library/postgres ) ,
6
+ > and included Barman Cloud built from source.
7
+ > This legacy approach, referred to as ` system ` images, will remain available
8
+ > for backward compatibility but is planned for a future deprecation.
2
9
3
- Maintenance scripts to generate Immutable Application Containers
4
- for all available PostgreSQL versions (13 to 17) to be used as
5
- operands with the [ CloudNativePG operator] ( https://cloudnative-pg.io )
6
- for Kubernetes.
10
+ ---
7
11
8
- These images are built on top of the [ Official Postgres image] ( https://hub.docker.com/_/postgres )
9
- maintained by the [ PostgreSQL Docker Community] ( https://github.com/docker-library/postgres ) ,
10
- by adding the following software:
12
+ # CNPG PostgreSQL Container Images
13
+
14
+ This repository provides maintenance scripts for generating immutable
15
+ application containers for all supported PostgreSQL versions (13 to 17).
16
+ These containers are designed to serve as operands for the
17
+ [ CloudNativePG (CNPG) operator] ( https://cloudnative-pg.io ) in Kubernetes
18
+ environments.
19
+
20
+ ## Key Features
21
+
22
+ The CNPG PostgreSQL Container Images:
23
+
24
+ - Are based on Debian Linux ` stable ` and ` oldstable `
25
+ - Support ** multi-architecture builds** , including ` linux/amd64 ` and
26
+ ` linux/arm64 ` .
27
+ - Include ** build attestations** , such as Software Bills of Materials (SBOMs)
28
+ and provenance metadata.
29
+ - Are published on the
30
+ [ CloudNativePG GitHub Container Registry] ( https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql ) .
31
+ - Are ** automatically rebuilt weekly** (every Monday) to ensure they remain
32
+ up-to-date.
33
+
34
+ ## Image Types
35
+
36
+ We currently build and support two primary types of PostgreSQL images:
37
+
38
+ - [ ` minimal ` ] ( #minimal-images )
39
+ - [ ` standard ` ] ( #standard-images )
40
+
41
+ Both ` minimal ` and ` standard ` images are intended to be used with backup
42
+ plugins, such as [ Barman Cloud] ( https://github.com/cloudnative-pg/plugin-barman-cloud ) .
43
+
44
+ > ** Note:** for backward compatibility, we also maintain the
45
+ > [ ` system ` ] ( #system-images ) image type. Switching from ` system ` images to
46
+ > ` minimal ` or ` standard ` images on an existing cluster is not supported.
47
+
48
+ ### Minimal Images
49
+
50
+ Minimal images are lightweight and built on top of the
51
+ [ official Debian images] ( https://hub.docker.com/_/debian ) .
52
+ They use the [ APT PostgreSQL packages] ( https://wiki.postgresql.org/wiki/Apt )
53
+ maintained by the PostgreSQL Global Development Group (PGDG).
54
+
55
+ These images are identified by the inclusion of ` minimal ` in their tag names,
56
+ for example: ` 17.2-minimal-bookworm ` .
57
+
58
+ ### Standard Images
59
+
60
+ Standard images are an extension of the ` minimal ` images, enhanced with the
61
+ following additional features:
62
+
63
+ - PGAudit
64
+ - Postgres Failover Slots
65
+ - pgvector
66
+ - All Locales
67
+
68
+ Standard images are identifiable by the ` standard ` tag in their names, such as:
69
+ ` 17.2-standard-bookworm ` .
70
+
71
+ > ** Note:** Standard images are designed to offer functionality equivalent to
72
+ > the legacy ` system ` images when used with CloudNativePG. To achieve parity,
73
+ > you must use the [ Barman Cloud Plugin] ( https://github.com/cloudnative-pg/plugin-barman-cloud )
74
+ > as a replacement for the native Barman Cloud support in ` system ` images.
75
+
76
+ ### System Images
77
+
78
+ System images are based on the [ Official Postgres image] ( https://hub.docker.com/_/postgres ) ,
79
+ maintained by the
80
+ [ PostgreSQL Docker Community] ( https://github.com/docker-library/postgres ) .
81
+ These images include additional software to extend PostgreSQL functionality:
11
82
12
83
- Barman Cloud
13
84
- PGAudit
14
85
- Postgres Failover Slots
15
86
- pgvector
16
87
17
- Currently, images are automatically rebuilt once a week (Monday).
88
+ The [ ` Debian ` ] ( Debian ) folder contains image catalogs, which can be used as:
89
+ - [ ` ClusterImageCatalog ` ] ( https://cloudnative-pg.io/documentation/current/image_catalog/ )
90
+ - [ ` ImageCatalog ` ] ( https://cloudnative-pg.io/documentation/current/image_catalog/ )
91
+
92
+ > ** Deprecation Notice:** System images and the associated Debian-based image
93
+ > catalogs will be deprecated in future releases of CloudNativePG and
94
+ > eventually removed. Users are encouraged to migrate to ` minimal ` or
95
+ > ` standard ` images for new clusters as soon as feasible.
96
+
97
+ ## Build Attestations
98
+
99
+ CNPG PostgreSQL Container Images are built with the following attestations to
100
+ ensure transparency and traceability:
101
+
102
+ - ** [ Software Bill of Materials
103
+ (SBOM)] ( https://docs.docker.com/build/metadata/attestations/sbom/ ) :** A
104
+ comprehensive list of software artifacts included in the image or used during
105
+ its build process, formatted using the [ in-toto SPDX predicate standard] ( https://github.com/in-toto/attestation/blob/main/spec/predicates/spdx.md ) .
106
+
107
+ - ** [ Provenance] ( https://docs.docker.com/build/metadata/attestations/slsa-provenance/ ) :**
108
+ Metadata detailing how the image was built, following the [ SLSA Provenance] ( https://slsa.dev )
109
+ framework.
110
+
111
+ For example, you can retrieve the SBOM for a specific image using the following
112
+ command:
113
+
114
+ ``` bash
115
+ docker buildx imagetools inspect < IMAGE> --format " {{ json .SBOM.SPDX }}"
116
+ ```
117
+
118
+ This command outputs the SBOM in JSON format, providing a detailed view of the
119
+ software components and build dependencies.
120
+
121
+ ## Building Images
122
+
123
+ For detailed instructions on building PostgreSQL container images, refer to the
124
+ [ BUILD.md] ( BUILD.md ) file.
125
+
126
+ ## License and copyright
127
+
128
+ This software is available under [ Apache License 2.0] ( LICENSE ) .
129
+
130
+ Copyright The CloudNativePG Contributors.
18
131
19
132
Barman Cloud is distributed by EnterpriseDB under the
20
133
[ GNU GPL 3 License] ( https://github.com/EnterpriseDB/barman/blob/master/LICENSE ) .
@@ -28,18 +141,8 @@ Postgres Failover Slots is distributed by EnterpriseDB under the
28
141
pgvector is distributed under the
29
142
[ PostgreSQL License] ( https://github.com/pgvector/pgvector/blob/master/LICENSE ) .
30
143
31
- Images are available via
32
- [ GitHub Container Registry] ( https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql ) .
33
-
34
- ## License and copyright
35
-
36
- This software is available under [ Apache License 2.0] ( LICENSE ) .
37
-
38
- Copyright The CloudNativePG Contributors.
39
-
40
144
## Trademarks
41
145
42
146
* [ Postgres, PostgreSQL and the Slonik Logo] ( https://www.postgresql.org/about/policies/trademarks/ )
43
147
are trademarks or registered trademarks of the PostgreSQL Community Association
44
148
of Canada, and used with their permission.*
45
-
0 commit comments