DotNetPublishSettingsExtensions.

WithContainerArchive(DotNetPublishSettings, FilePath, string) Method

Summary

Publishes the project as a container image written to a .tar.gz archive. Creates Container if not set, otherwise keeps its other settings, and clears any local registry or registry destination.

Syntax

public static DotNetPublishSettings WithContainerArchive(this DotNetPublishSettings settings, FilePath archiveOutputPath, string baseImage = null)

Examples

DotNetPublish("./src/hwapp/hwapp.csproj", new DotNetPublishSettings
{
    Container = new DotNetPublishContainerSettings
    {
        Repository = "cake-it-hwapp",
        ImageTags = ["1.0.0", "latest"]
    }
}.WithContainerArchive("./artifacts/hwapp.tar.gz"));

Parameters

Name Type Description
settings DotNetPublishSettings The settings.
archiveOutputPath FilePath The path of the .tar.gz archive.
baseImage string The optional base image, i.e. mcr.microsoft.com/dotnet/sdk:11.0-resolute-aot, replaces any base image when set.

Return Value

Type Description
DotNetPublishSettings The same DotNetPublishSettings instance so that multiple calls can be chained.