Skip to content

Commit a334f95

Browse files
committed
Address issue #44537
1 parent b4b9103 commit a334f95

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/core/containers/publish-configuration.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Containerize a .NET app reference
33
description: Reference material for containerizing a .NET app and configuring the container image.
44
ms.topic: reference
5-
ms.date: 01/07/2025
5+
ms.date: 01/27/2025
66
---
77

88
# Containerize a .NET app reference
@@ -176,12 +176,27 @@ To specify multiple tags, use a semicolon-delimited set of tags in the `Containe
176176
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.
177177

178178
> [!NOTE]
179-
> 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:
179+
> 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:
180180
>
181-
> ```dotnetcli
182-
> dotnet publish -p ContainerImageTags='"1.2.3-alpha2;latest"'
181+
> ### [PowerShell](#tab/powershell)
182+
>
183+
> ```powershell
184+
> dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=`"1.2.3-alpha2`;latest`"
183185
> ```
184186
>
187+
> In PowerShell, both the `;` and `"` characters need to be escaped.
188+
>
189+
>
190+
> ### [Bash](#tab/bash)
191+
>
192+
> ```bash
193+
> dotnet publish --os linux --arch x64 /t:PublishContainer /p:ContainerImageTags=\"1.2.3-alpha2;latest\"
194+
> ```
195+
>
196+
> In Bash, only the `"` character needs to be escaped.
197+
>
198+
> ---
199+
>
185200
> This results in two images being generated: `my-app:1.2.3-alpha2` and `my-app:latest`.
186201
187202
> [!TIP]

0 commit comments

Comments
 (0)