1 write to Resource
Aspire.Hosting (1)
ApplicationModel\DockerfileBuilderCallbackContext.cs (1)
23Resource = resource ?? throw new ArgumentNullException(nameof(resource));
58 references to Resource
Aspire.Hosting.Blazor (2)
BlazorGatewayExtensions.cs (2)
74ctx.Builder.AddContainerFilesStages(ctx.Resource, logger); 80.AddContainerFiles(ctx.Resource, "/app", logger)
Aspire.Hosting.Go (9)
GoHostingExtensions.cs (9)
175ctx.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 182var binaryName = ctx.Resource.Name; 183var buildCmd = BuildDockerGoCommand(ctx.Resource, packagePath, binaryName); 186var hasPrivate = ctx.Resource.TryGetLastAnnotation<GoPrivateAnnotation>(out var privateAnnotation); 255ctx.Builder.AddContainerFilesStages(ctx.Resource, logger); 279.AddContainerFiles(ctx.Resource, "/app", logger) 280.CopyFrom("build", $"/app/{ctx.Resource.Name}", $"/app/{ctx.Resource.Name}") 282.Entrypoint([$"/app/{ctx.Resource.Name}"]);
Aspire.Hosting.Java (4)
JavaDockerfileGenerator.cs (4)
120if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 132context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 146context.Builder.AddContainerFilesStages(context.Resource, logger); 153.AddContainerFiles(context.Resource, "/app", logger);
Aspire.Hosting.JavaScript (21)
JavaScriptHostingExtensions.cs (21)
196dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 240dockerfileContext.Builder.AddContainerFilesStages(dockerfileContext.Resource, logger); 248.AddContainerFiles(dockerfileContext.Resource, "/app", logger) 520dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 531if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 574dockerfileContext.Builder.AddContainerFilesStages(dockerfileContext.Resource, logger); 651.AddContainerFiles(dockerfileContext.Resource, "/app", logger) 894dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 900if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 905ThrowIfUnsupportedDenoDockerfileOptions(dockerfileContext.Resource); 919dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 922if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 923!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 944var denoCacheCommand = BuildDenoCacheCommand(dockerfileContext.Resource, scriptPath, resource.WorkingDirectory); 958if (dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 960if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 971dockerfileContext.Builder.AddContainerFilesStages(dockerfileContext.Resource, logger); 1001.AddContainerFiles(dockerfileContext.Resource, "/app", logger) 1019runtimeStage.Entrypoint(BuildDenoEntrypoint(dockerfileContext.Resource, resource.Command, scriptPath)); 1691dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 1698dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation);
Aspire.Hosting.Python (9)
PythonAppResourceBuilderExtensions.cs (9)
440if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 447context.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnvironmentAnnotation); 464var isUsingUv = context.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 534context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 587context.Builder.AddContainerFilesStages(context.Resource, logger); 592.AddContainerFiles(context.Resource, "/app", logger) 635context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 643context.Builder.AddContainerFilesStages(context.Resource, logger); 648.AddContainerFiles(context.Resource, "/app", logger)
Aspire.Hosting.Rust (4)
RustDockerfileGenerator.cs (4)
65if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 151context.Builder.AddContainerFilesStages(context.Resource, logger); 160.AddContainerFiles(context.Resource, "/app", logger) 482=> context.Resource.Annotations.OfType<DockerfileBaseImageAnnotation>().LastOrDefault()
Aspire.Hosting.Tests (4)
ApplicationModel\Docker\DockerfileBuilderCallbackContextTests.cs (4)
24Assert.Same(resource, context.Resource); 72Assert.Same(resource, context.Resource); 132Assert.Equal("mycontainer", context.Resource.Name); 133Assert.IsAssignableFrom<IResource>(context.Resource);
Aspire.Hosting.Yarp (3)
YarpResourceExtensions.cs (3)
251var imageName = GetYarpImageName(ctx.Resource); 253ctx.Builder.AddContainerFilesStages(ctx.Resource, logger); 257.AddContainerFiles(ctx.Resource, "/app/wwwroot", logger);
WithDockerfile.AppHost (2)
AppHost.cs (2)
59if (!context.Resource.TryGetContainerImageName(useBuiltImage: false, out var imageName)) 73if (!context.Resource.TryGetContainerImageName(useBuiltImage: false, out var imageName))