Skip to content

Commit 9acf40d

Browse files
committed
update container labels docs with complete table of labels provided in-box
1 parent a1f1c09 commit 9acf40d

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

docs/core/containers/publish-configuration.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ For example, consider the fully qualified `mcr.microsoft.com/dotnet/runtime:8.0-
4949
Some properties described in the following sections correspond to managing parts of the generated image name. Consider the following table that maps the relationship between the image name and the build properties:
5050

5151
| Image name part | MSBuild property | Example values |
52-
|-------------------|-----------------------|-------------------------|
52+
| ----------------- | --------------------- | ----------------------- |
5353
| `REGISTRY[:PORT]` | `ContainerRegistry` | `mcr.microsoft.com:443` |
5454
| `PORT` | `ContainerPort` | `:443` |
5555
| `REPOSITORY` | `ContainerRepository` | `dotnet/runtime` |
@@ -411,11 +411,27 @@ dotnet publish -p ContainerUser=root
411411

412412
### Default container labels
413413

414-
Labels are often used to provide consistent metadata on container images. This package provides some default labels to encourage better maintainability of the generated images.
414+
Labels are often used to provide consistent metadata on container images. This package provides some default labels to encourage better maintainability of the generated images. All default label generation can be disabled by setting `ContainerGenerateLabels` to `false`. In addition, each default label has an individual enablement flag that can be set to `false` to disable that specific label.
415415

416-
- `org.opencontainers.image.created` is set to the ISO 8601 format of the current value of <xref:System.DateTime.UtcNow?displayProperty=nameWithType>.
416+
Where possible, we try to make use of existing MSBuild properties to provide the values for these labels, though we also provide properties that allow for explicit control of the values.
417+
418+
419+
| Annotation | Default Value | Dedicated Property Name | Fallback Property Name | Enabled Property Name | Notes |
420+
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
421+
| `org.opencontainers.image.created` and `org.opencontainers.artifact.created` | the [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6) format of the current UTC DateTime | | | `ContainerGenerateLabelsImageCreated` | |
422+
| `org.opencontainers.artifact.description` and `org.opencontainers.image.description` | | `ContainerDescription` | `Description` | `ContainerGenerateLabelsImageDescription` | |
423+
| `org.opencontainers.image.authors` | | `ContainerAuthors` | `Authors` | `ContainerGenerateLabelsImageAuthors` | |
424+
| `org.opencontainers.image.url` | | `ContainerInformationUrl` | `PackageProjectUrl` | `ContainerGenerateLabelsImageUrl` | |
425+
| `org.opencontainers.image.documentation` | | `ContainerDocumentationUrl` | `PackageProjectUrl` | `ContainerGenerateLabelsImageDocumentation` | |
426+
| `org.opencontainers.image.version` | | `ContainerVersion` | `PackageVersion` | `ContainerGenerateLabelsImageVersion` | |
427+
| `org.opencontainers.image.vendor` | | `ContainerVendor` | | `ContainerGenerateLabelsImageVendor` | |
428+
| `org.opencontainers.image.licenses` | | `ContainerLicenseExpression` | `PackageLicenseExpression` | `ContainerGenerateLabelsImageLicenses` | |
429+
| `org.opencontainers.image.title` | | `ContainerTitle` | `Title` | `ContainerGenerateLabelsImageTitle` | |
430+
| `org.opencontainers.image.base.name` | | `ContainerBaseImage` | | `ContainerGenerateLabelsImageBaseName` | |
431+
| `org.opencontainers.image.base.digest` | | | | `ContainerGenerateLabelsImageBaseDigest` | This will be the SHA digest of the chosen base image. Available from .NET SDK 9.0.100 onwards. |
432+
| `org.opencontainers.image.source` | | `PrivateRepositoryUrl` | | `ContainerGenerateLabelsImageSource` | Only written if `PublishRepositoryUrl` is `true`. Also relies on Sourcelink infrastructure being part of the build. |
433+
| `org.opencontainers.image.revision` | | `SourceRevisionId` | | `ContainerGenerateLabelsImageRevision` | Only written if `PublishRepositoryUrl` is `true`. Also relies on Sourcelink infrastructure being part of the build. |
417434

418-
For more information, see [Implement conventional labels on top of existing label infrastructure](https://github.com/dotnet/sdk-container-builds/issues/96).
419435

420436
## See also
421437

0 commit comments

Comments
 (0)