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