Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ private async Task BuildContainerImageFromDockerfileAsync(string resourceName, D
resolvedBuildSecrets[buildSecret.Key] = await ResolveValue(buildSecret.Value, cancellationToken).ConfigureAwait(false);
}

// ensure outputPath is created if specified since docker/podman won't create it for us
if (options?.OutputPath is { } outputPath)
{
Directory.CreateDirectory(outputPath);
}

if (publishingTask is not null)
{
await using (publishingTask.ConfigureAwait(false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ public async Task CanBuildImageFromDockerfileResource_WithAllOptionsSet()

using var app = builder.Build();

var tempOutputPath = Path.GetTempPath();
using var tempDir = new TempDirectory();
var options = new ContainerBuildOptions
{
ImageFormat = ContainerImageFormat.Oci,
OutputPath = tempOutputPath,
OutputPath = Path.Combine(tempDir.Path, "NewFolder"), // tests that the folder is created if it doesn't exist
TargetPlatform = ContainerTargetPlatform.LinuxAmd64
};

Expand Down