20 instantiations of DockerfileBuildAnnotation
Aspire.Hosting (2)
ContainerResourceBuilderExtensions.cs (2)
688var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 838var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage)
Aspire.Hosting.Blazor.Tests (1)
AddBlazorGatewayTests.cs (1)
232gatewayContainer.Annotations.Add(new DockerfileBuildAnnotation(gatewayDirectory, Path.Combine(gatewayDirectory, "Dockerfile"), stage: null)
Aspire.Hosting.Rust (2)
RustHostingExtensions.cs (2)
751new DockerfileBuildAnnotation( 820return new DockerfileBuildAnnotation(workingDirectory, dockerfilePath, stage)
Aspire.Hosting.Tests (15)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (11)
13var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 27var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 39var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 55var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 72var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 103var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 139var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 179var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 229var annotation = new DockerfileBuildAnnotation(workspace.WorkspaceRoot.FullName, dockerfilePath, null); 249var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null) 283var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null)
BuildOnlyContainerValidationTests.cs (1)
96.WithAnnotation(new DockerfileBuildAnnotation("context", "Dockerfile", null) { HasEntrypoint = false })
DistributedApplicationModelExtensionsTests.cs (2)
51containerWithDockerfile.Resource.Annotations.Add(new DockerfileBuildAnnotation("/context", "/Dockerfile", null)); 55buildOnlyContainer.Resource.Annotations.Add(new DockerfileBuildAnnotation("/context", "/Dockerfile", null) { HasEntrypoint = false });
Publishing\ResourceContainerImageManagerTests.cs (1)
1818var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null)
199 references to DockerfileBuildAnnotation
Aspire.Hosting (26)
ApplicationModel\ResourceExtensions.cs (5)
944resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 1012resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 1033return resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuild) && 1040!resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _);
ContainerResourceBuilderExtensions.cs (12)
366if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 460if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation) 688var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 694if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 838var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage) 847if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 1154var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault(); 1285var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault();
Dcp\ContainerCreator.cs (1)
615if (modelContainerResource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } dockerfileBuildAnnotation)
Publishing\ManifestPublishingContext.cs (2)
333if (container.Annotations.OfType<DockerfileBuildAnnotation>().Any()) 384if (container.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out var annotations) && annotations.Single() is { } annotation)
Publishing\ResourceContainerImageManager.cs (5)
401if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 907resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _)) 938private async Task BuildContainerImageFromDockerfileAsync(IResource resource, DockerfileBuildAnnotation dockerfileBuildAnnotation, string imageName, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 1047resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
Utils\DockerfileHelper.cs (1)
21DockerfileBuildAnnotation annotation,
Aspire.Hosting.Azure (2)
AzurePublishingContext.cs (2)
450if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
Aspire.Hosting.Azure.AppContainers (1)
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceEnvironmentResource.cs (1)
215!(resource.IsContainer() && resource.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out _)))
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
492if (containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation))
Aspire.Hosting.Azure.Tests (10)
AzureContainerAppsTests.cs (2)
2749var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AzureDeployerTests.cs (2)
359var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AzureFunctionsTests.cs (6)
515var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 555var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 576var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Blazor.Tests (4)
AddBlazorGatewayTests.cs (4)
100var build = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 226var gatewayBuild = Assert.Single(gatewayContainer.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Containers.Tests (34)
WithDockerfileTests.cs (34)
108Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 133Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 152Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 156Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 174Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 178Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 654var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 670var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 687var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 703var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 720var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 736var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 753var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 769var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 794var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 846var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 899var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Docker (2)
DockerComposePublishingContext.cs (2)
85if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
Aspire.Hosting.Dotnet.Tests (2)
DotnetProjectResourceTests.cs (2)
463var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFMigrationPipelineTests.cs (4)
468var dockerfileAnnotation = Assert.Single(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 490Assert.Empty(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 505Assert.Empty(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
455Assert.DoesNotContain(agent.Resource.Annotations, annotation => annotation is DockerfileBuildAnnotation);
Aspire.Hosting.Java (2)
JavaDockerfileGenerator.cs (2)
120if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)
Aspire.Hosting.Java.Tests (2)
AddJavaAppPublishTests.cs (2)
2379var annotation = model.Resources 2380.SelectMany(resource => resource.Annotations.OfType<DockerfileBuildAnnotation>())
Aspire.Hosting.JavaScript (16)
JavaScriptHostingExtensions.cs (16)
531if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 900if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1356if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1420if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1500if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1887if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation)) 1950!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 2250if (resourceBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation))
Aspire.Hosting.JavaScript.Tests (18)
AddBunAppTests.cs (4)
50var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 102var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddDenoAppTests.cs (4)
78var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 135var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddJavaScriptAppTests.cs (2)
38var dockerBuildAnnotation = yarnApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddNodeAppTests.cs (2)
155var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddViteAppTests.cs (6)
74var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 100var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 204var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Kubernetes (2)
KubernetesPublishingContext.cs (2)
84if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
Aspire.Hosting.Rust (10)
RustDockerfileGenerator.cs (2)
65if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)
RustHostingExtensions.cs (8)
148|| !containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var provisionalDockerfile)) 720DockerfileBuildAnnotation provisionalDockerfile, 730if (!containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var activeDockerfile) 770var dockerfile = annotations.OfType<DockerfileBuildAnnotation>().Last(); 808private static DockerfileBuildAnnotation CreateGeneratedDockerfileAnnotation(
Aspire.Hosting.Rust.Tests (8)
AddRustAppPublishTests.cs (8)
539var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 562var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 1017var initialDockerfile = Assert.Single(initialContainer.Annotations.OfType<DockerfileBuildAnnotation>()); 1022var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Tests (38)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (11)
13var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 27var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 39var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 55var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 72var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 103var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 139var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 179var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 229var annotation = new DockerfileBuildAnnotation(workspace.WorkspaceRoot.FullName, dockerfilePath, null); 249var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null) 283var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null)
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (20)
68var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 89var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 141var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 177var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 211var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 252var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 331var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 367var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 399var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 433var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault();
Publishing\ResourceContainerImageManagerTests.cs (7)
1563var annotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 1767var dockerfileBuildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 1818var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null) 1829if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
Aspire.Hosting.Yarp.Tests (14)
AddYarpTests.cs (14)
214var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 227var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 261Assert.Empty(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 288Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 305var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 335var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 368var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 406var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>());