From a334f95ead35467d0b5888fbe0ab0ae5efaba151 Mon Sep 17 00:00:00 2001 From: David Pine Date: Mon, 27 Jan 2025 10:06:01 -0600 Subject: [PATCH 1/2] Address issue #44537 --- docs/core/containers/publish-configuration.md | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/core/containers/publish-configuration.md b/docs/core/containers/publish-configuration.md index 0c3bd713cc96f..c0a4dc1bec399 100644 --- a/docs/core/containers/publish-configuration.md +++ b/docs/core/containers/publish-configuration.md @@ -2,7 +2,7 @@ title: Containerize a .NET app reference description: Reference material for containerizing a .NET app and configuring the container image. ms.topic: reference -ms.date: 01/07/2025 +ms.date: 01/27/2025 --- # Containerize a .NET app reference @@ -176,12 +176,27 @@ To specify multiple tags, use a semicolon-delimited set of tags in the `Containe Tags can only contain up to 127 alphanumeric characters, periods, underscores, and dashes. They must start with an alphanumeric character or an underscore. Any other form results in an error being thrown. > [!NOTE] -> When using `ContainerImageTags`, the tags are delimited by a `;` character. If you're calling `dotnet publish` from the command line (as is the case with most CI/CD environments), you need to outer wrap the values in a single `'` and inner wrap with double quotes `"`, for example (`='"tag-1;tag-2"'`). Consider the following `dotnet publish` command: +> When using `ContainerImageTags` or any MSBuild property that needs to configure `;` delimited values. If you're calling `dotnet publish` from the command line (as is the case with most CI/CD environments), you need to understand the limitations of the environment's inability to disambiguate delimiters and quotations, thus requiring proper escaping. This differs between PowerShell and Bash. Consider the following `dotnet publish` command: > -> ```dotnetcli -> dotnet publish -p ContainerImageTags='"1.2.3-alpha2;latest"' +> ### [PowerShell](#tab/powershell) +> +> ```powershell +> dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=`"1.2.3-alpha2`;latest`" > ``` > +> In PowerShell, both the `;` and `"` characters need to be escaped. +> +> +> ### [Bash](#tab/bash) +> +> ```bash +> dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=\"1.2.3-alpha2;latest\" +> ``` +> +> In Bash, only the `"` character needs to be escaped. +> +> --- +> > This results in two images being generated: `my-app:1.2.3-alpha2` and `my-app:latest`. > [!TIP] From 4bd681567969fd2f0f4fc8def43b29d21b9cf428 Mon Sep 17 00:00:00 2001 From: David Pine Date: Mon, 27 Jan 2025 10:12:20 -0600 Subject: [PATCH 2/2] Remove tabs --- docs/core/containers/publish-configuration.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/core/containers/publish-configuration.md b/docs/core/containers/publish-configuration.md index c0a4dc1bec399..ef389608205ea 100644 --- a/docs/core/containers/publish-configuration.md +++ b/docs/core/containers/publish-configuration.md @@ -176,9 +176,7 @@ To specify multiple tags, use a semicolon-delimited set of tags in the `Containe Tags can only contain up to 127 alphanumeric characters, periods, underscores, and dashes. They must start with an alphanumeric character or an underscore. Any other form results in an error being thrown. > [!NOTE] -> When using `ContainerImageTags` or any MSBuild property that needs to configure `;` delimited values. If you're calling `dotnet publish` from the command line (as is the case with most CI/CD environments), you need to understand the limitations of the environment's inability to disambiguate delimiters and quotations, thus requiring proper escaping. This differs between PowerShell and Bash. Consider the following `dotnet publish` command: -> -> ### [PowerShell](#tab/powershell) +> When using `ContainerImageTags` or any MSBuild property that needs to configure `;` delimited values. If you're calling `dotnet publish` from the command line (as is the case with most CI/CD environments), you need to understand the limitations of the environment's inability to disambiguate delimiters and quotations, thus requiring proper escaping. This differs between PowerShell and Bash. Consider the following `dotnet publish` commands in their respective environments: > > ```powershell > dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=`"1.2.3-alpha2`;latest`" @@ -186,17 +184,12 @@ Tags can only contain up to 127 alphanumeric characters, periods, underscores, a > > In PowerShell, both the `;` and `"` characters need to be escaped. > -> -> ### [Bash](#tab/bash) -> > ```bash > dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=\"1.2.3-alpha2;latest\" > ``` > > In Bash, only the `"` character needs to be escaped. > -> --- -> > This results in two images being generated: `my-app:1.2.3-alpha2` and `my-app:latest`. > [!TIP]