11 instantiations of DockerfileBuildAnnotation
Aspire.Hosting (2)
ContainerResourceBuilderExtensions.cs (2)
579var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 718var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage)
Aspire.Hosting.Tests (9)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (8)
14var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 28var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 40var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 56var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 73var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 104var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 140var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 180var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null)
Publishing\ResourceContainerImageManagerTests.cs (1)
987var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null)
127 references to DockerfileBuildAnnotation
Aspire.Hosting (24)
ApplicationModel\ResourceExtensions.cs (4)
879resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 937return resource is ProjectResource || resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 956return resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuild) &&
ContainerResourceBuilderExtensions.cs (12)
293if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 383if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation) 579var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 585if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 718var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage) 727if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 1010var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault(); 1108var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault();
Dcp\DcpExecutor.cs (1)
2116if (modelContainerResource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } dockerfileBuildAnnotation)
Publishing\ManifestPublishingContext.cs (2)
317if (container.Annotations.OfType<DockerfileBuildAnnotation>().Any()) 368if (container.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out var annotations) && annotations.Single() is { } annotation)
Publishing\ResourceContainerImageManager.cs (4)
228else if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 380private async Task BuildContainerImageFromDockerfileAsync(IResource resource, DockerfileBuildAnnotation dockerfileBuildAnnotation, string imageName, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 484resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _));
Utils\DockerfileHelper.cs (1)
21DockerfileBuildAnnotation annotation,
Aspire.Hosting.Azure (2)
AzurePublishingContext.cs (2)
315if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
Aspire.Hosting.Azure.AppContainers (1)
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceInfrastructure.cs (1)
54if (resource is not ProjectResource && !(resource.IsContainer() && resource.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out _)))
Aspire.Hosting.Azure.Tests (4)
AzureContainerAppsTests.cs (2)
1983var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AzureDeployerTests.cs (2)
165var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Containers.Tests (34)
WithDockerfileTests.cs (34)
109Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 133Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 151Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 155Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 172Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 176Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 643var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 658var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 674var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 689var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 705var 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>()); 751var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 775var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 826var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 876var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Docker (3)
DockerComposePublishingContext.cs (2)
86if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
DockerComposeServiceResource.cs (1)
137if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource)
Aspire.Hosting.JavaScript (2)
JavaScriptHostingExtensions.cs (2)
447if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation))
Aspire.Hosting.JavaScript.Tests (6)
AddJavaScriptAppTests.cs (2)
42var dockerBuildAnnotation = yarnApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddNodeAppTests.cs (2)
148var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddViteAppTests.cs (2)
70var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Kubernetes (3)
KubernetesPublishingContext.cs (2)
74if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
KubernetesResource.cs (1)
135if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not ProjectResource)
Aspire.Hosting.Tests (33)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (8)
14var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 28var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 40var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 56var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 73var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 104var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 140var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 180var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null)
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (20)
69var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 90var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 142var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 178var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 212var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 253var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 332var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 368var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 400var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 434var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault();
Publishing\ResourceContainerImageManagerTests.cs (5)
966var dockerfileBuildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 987var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null) 998if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
Aspire.Hosting.Yarp.Tests (14)
AddYarpTests.cs (14)
190var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 203var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 237Assert.Empty(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 264Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 281var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 311var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 344var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 382var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>());