19 instantiations of DockerfileBuildAnnotation
Aspire.Hosting (2)
ContainerResourceBuilderExtensions.cs (2)
691var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 841var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage)
Aspire.Hosting.Rust (2)
RustHostingExtensions.cs (2)
754new DockerfileBuildAnnotation( 823return new DockerfileBuildAnnotation(workingDirectory, dockerfilePath, stage)
Aspire.Hosting.Tests (15)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (11)
15var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 29var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 41var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 57var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 74var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 105var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 141var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 181var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 231var annotation = new DockerfileBuildAnnotation(workspace.WorkspaceRoot.FullName, dockerfilePath, null); 251var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null) 285var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null)
BuildOnlyContainerValidationTests.cs (1)
98.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)
1820var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null)
187 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)
369if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 463if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation) 691var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, fullyQualifiedDockerfilePath, stage); 697if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 841var annotation = new DockerfileBuildAnnotation(fullyQualifiedContextPath, tempDockerfilePath, stage) 850if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 1151var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault(); 1282var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault();
Dcp\ContainerCreator.cs (1)
615if (modelContainerResource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } dockerfileBuildAnnotation)
Publishing\ManifestPublishingContext.cs (2)
327if (container.Annotations.OfType<DockerfileBuildAnnotation>().Any()) 378if (container.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out var annotations) && annotations.Single() is { } annotation)
Publishing\ResourceContainerImageManager.cs (5)
404if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 910resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _)) 941private async Task BuildContainerImageFromDockerfileAsync(IResource resource, DockerfileBuildAnnotation dockerfileBuildAnnotation, string imageName, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 1050resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
Utils\DockerfileHelper.cs (1)
21DockerfileBuildAnnotation annotation,
Aspire.Hosting.Azure (2)
AzurePublishingContext.cs (2)
418if (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)
217!(resource.IsContainer() && resource.TryGetAnnotationsOfType<DockerfileBuildAnnotation>(out _)))
Aspire.Hosting.Azure.Tests (4)
AzureContainerAppsTests.cs (2)
2748var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AzureDeployerTests.cs (2)
175var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Containers.Tests (34)
WithDockerfileTests.cs (34)
110Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 135Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 154Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 158Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 176Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 180Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 656var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 672var 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>()); 722var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 738var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 755var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 771var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 796var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 848var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 901var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Docker (2)
DockerComposePublishingContext.cs (2)
86if (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)
454Assert.DoesNotContain(agent.Resource.Annotations, annotation => annotation is DockerfileBuildAnnotation);
Aspire.Hosting.Java (2)
JavaDockerfileGenerator.cs (2)
122if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)
Aspire.Hosting.Java.Tests (2)
AddJavaAppPublishTests.cs (2)
2381var annotation = model.Resources 2382.SelectMany(resource => resource.Annotations.OfType<DockerfileBuildAnnotation>())
Aspire.Hosting.JavaScript (16)
JavaScriptHostingExtensions.cs (16)
533if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 902if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1358if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1422if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1502if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1889if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation)) 1952!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 2252if (resourceBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation))
Aspire.Hosting.JavaScript.Tests (18)
AddBunAppTests.cs (4)
52var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 104var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddDenoAppTests.cs (4)
79var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 136var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddJavaScriptAppTests.cs (2)
39var dockerBuildAnnotation = yarnApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddNodeAppTests.cs (2)
157var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddViteAppTests.cs (6)
76var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 102var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 206var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
Aspire.Hosting.Kubernetes (2)
KubernetesPublishingContext.cs (2)
85if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
Aspire.Hosting.Rust (10)
RustDockerfileGenerator.cs (2)
67if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)
RustHostingExtensions.cs (8)
151|| !containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var provisionalDockerfile)) 723DockerfileBuildAnnotation provisionalDockerfile, 733if (!containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var activeDockerfile) 773var dockerfile = annotations.OfType<DockerfileBuildAnnotation>().Last(); 811private static DockerfileBuildAnnotation CreateGeneratedDockerfileAnnotation(
Aspire.Hosting.Rust.Tests (8)
AddRustAppPublishTests.cs (8)
541var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 564var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 1019var initialDockerfile = Assert.Single(initialContainer.Annotations.OfType<DockerfileBuildAnnotation>()); 1024var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.Tests (38)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (11)
15var annotation = new DockerfileBuildAnnotation("/path/to/context", "/path/to/Dockerfile", "stage"); 29var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 41var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 57var annotation = new DockerfileBuildAnnotation("/context", "/dockerfile", null); 74var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null); 105var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 141var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 181var annotation = new DockerfileBuildAnnotation("/context", dockerfilePath, null) 231var annotation = new DockerfileBuildAnnotation(workspace.WorkspaceRoot.FullName, dockerfilePath, null); 251var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null) 285var annotation = new DockerfileBuildAnnotation(contextPath, dockerfilePath, null)
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (20)
70var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 91var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 143var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 179var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 213var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 254var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 333var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 369var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 401var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 435var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault();
Publishing\ResourceContainerImageManagerTests.cs (7)
1565var annotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 1769var dockerfileBuildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 1820var dockerfileBuildAnnotation = new DockerfileBuildAnnotation(tempContextPath, tempDockerfilePath, null) 1831if (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>());