Add OCI image labels
Recipe ID
org.openrewrite.docker.AddOciLabelsArtifact
org.openrewrite:rewrite-dockerAdds standard OCI (Open Container Initiative) image labels to a Dockerfile. These labels provide metadata about the image such as title, version, source, and license information. See https://github.com/opencontainers/image-spec/blob/main/annotations.md for the specification.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.docker.AddOciLabelsIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite:rewrite-docker:8.88.0Options
| Name | Type | Description |
|---|---|---|
title | String | Human-readable title of the image (org.opencontainers.image.title). e.g. My Application |
description | String | Human-readable description of the image (org.opencontainers.image.description). e.g. A containerized web application |
version | String | Version of the packaged software (org.opencontainers.image.version). e.g. 1.0.0 |
created | String | Date and time the image was built in RFC 3339 format. If 'now', uses the current time. e.g. 2024-01-15T10:30:00Z |
revision | String | Source control revision identifier for the packaged software (org.opencontainers.image.revision). e.g. abc123def456 |
source | String | URL to get source code for building the image (org.opencontainers.image.source). e.g. https://github.com/myorg/myapp |
url | String | URL to find more information about the image (org.opencontainers.image.url). e.g. https://myapp.example.com |
vendor | String | Name of the distributing entity, organization, or individual (org.opencontainers.image.vendor). e.g. My Organization |
licenses | String | License(s) under which contained software is distributed as a SPDX License Expression (org.opencontainers.image.licenses). e.g. Apache-2.0 |
authors | String | Contact details of the people or organization responsible (org.opencontainers.image.authors). e.g. maintainers@example.com |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats