Skip to content

Commit bc057aa

Browse files
committed
docs: add image labels and annotations documentation
Add comprehensive documentation section describing OCI-compliant labels and CloudNativePG-specific annotations available in extension images. This documents the labels added in #43, including pgmajor and OS distribution metadata, plus standard OCI image specification labels. Relates to #43 Signed-off-by: Marco Nenciarini <[email protected]>
1 parent 6b186a4 commit bc057aa

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,44 @@ This scheme ensures:
117117
- Alignment with the upstream `postgres-containers` base images
118118
- Explicit PostgreSQL and extension versioning
119119
- Multi-distro support
120+
121+
---
122+
123+
## Image Labels
124+
125+
Each extension image includes OCI-compliant labels for runtime inspection
126+
and tooling integration. These metadata fields enable CloudNativePG and
127+
other tools to identify the base PostgreSQL version and OS distribution.
128+
129+
### CloudNativePG-Specific Labels
130+
131+
| Label | Description | Example |
132+
| :--- | :--- | :--- |
133+
| `io.cloudnativepg.image.base.name` | Base PostgreSQL container image | `ghcr.io/cloudnative-pg/postgresql:18-minimal-bookworm` |
134+
| `io.cloudnativepg.image.base.pgmajor` | PostgreSQL major version | `18` |
135+
| `io.cloudnativepg.image.base.os` | Operating system distribution | `bookworm` |
136+
137+
### Standard OCI Labels
138+
139+
In addition to CloudNativePG-specific labels, all images include standard OCI
140+
annotations as defined by the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/main/annotations.md):
141+
142+
| Label | Description |
143+
| :--- | :--- |
144+
| `org.opencontainers.image.created` | Image creation timestamp |
145+
| `org.opencontainers.image.version` | Extension version |
146+
| `org.opencontainers.image.revision` | Git commit SHA |
147+
| `org.opencontainers.image.title` | Human-readable image title |
148+
| `org.opencontainers.image.description` | Image description |
149+
| `org.opencontainers.image.source` | Source repository URL |
150+
| `org.opencontainers.image.licenses` | License identifier (Apache-2.0) |
151+
152+
You can inspect these labels using container tools:
153+
154+
```bash
155+
# Using docker buildx imagetools
156+
docker buildx imagetools inspect <image> --raw | jq '.annotations'
157+
158+
# Using skopeo
159+
skopeo inspect docker://<image> | jq '.Labels'
160+
```

0 commit comments

Comments
 (0)