9 types derived from ContainerResource
Aspire.Hosting.Elasticsearch (1)
ElasticsearchResource.cs (1)
9public class ElasticsearchResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Milvus (1)
MilvusServerResource.cs (1)
11public class MilvusServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.MySql (1)
MySqlServerResource.cs (1)
9public class MySqlServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
9public class OracleDatabaseServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.PostgreSQL (1)
PostgresServerResource.cs (1)
12public class PostgresServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Qdrant (1)
QdrantServerResource.cs (1)
9public class QdrantServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.RabbitMQ (1)
RabbitMQServerResource.cs (1)
9public class RabbitMQServerResource : ContainerResource, IResourceWithConnectionString, IResourceWithEnvironment
Aspire.Hosting.SqlServer (1)
SqlServerServerResource.cs (1)
9public class SqlServerServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Tests (1)
ExpressionResolverTests.cs (1)
121sealed class TestExpressionResolverResource : ContainerResource, IResourceWithEndpoints, IResourceWithConnectionString
11 instantiations of ContainerResource
Aspire.Hosting.Tests (11)
DistributedApplicationBuilderTests.cs (8)
126appBuilder.AddResource(new ContainerResource("Test")); 128var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 137appBuilder.AddResource(new ContainerResource("Test")); 139var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST"))); 148appBuilder.Resources.Add(new ContainerResource("Test")); 149appBuilder.Resources.Add(new ContainerResource("Test")); 160appBuilder.Resources.Add(new ContainerResource("Test")); 161appBuilder.Resources.Add(new ContainerResource("TEST"));
ExpressionResolverTests.cs (3)
58var source = builder.AddResource(new ContainerResource("testSource")) 86var test = builder.AddResource(new ContainerResource("testSource")) 108var test = builder.AddResource(new ContainerResource("testSource"))
44 references to ContainerResource
Aspire.Hosting (36)
ApplicationModel\ContainerLifetimeAnnotation.cs (3)
22/// current <see cref="ContainerResource"/> configuration. 26/// <item>If the container WAS originally created by Aspire, and the <see cref="ContainerResource"/> configuration DOES match the existing container, the existing container will be re-used.</item> 27/// <item>If the container WAS originally created by Aspire, and the <see cref="ContainerResource"/> configuration DOES NOT match the existing container, the existing container will be stopped and a new container created in order to apply the updated configuration.</item>
ContainerResourceBuilderExtensions.cs (25)
21public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image) 38public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image, string tag) 45var container = new ContainerResource(name); 59public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string? name, string target, bool isReadOnly = false) where T : ContainerResource 75public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string target) where T : ContainerResource 93public static IResourceBuilder<T> WithBindMount<T>(this IResourceBuilder<T> builder, string source, string target, bool isReadOnly = false) where T : ContainerResource 110public static IResourceBuilder<T> WithEntrypoint<T>(this IResourceBuilder<T> builder, string entrypoint) where T : ContainerResource 126public static IResourceBuilder<T> WithImageTag<T>(this IResourceBuilder<T> builder, string tag) where T : ContainerResource 147public static IResourceBuilder<T> WithImageRegistry<T>(this IResourceBuilder<T> builder, string? registry) where T : ContainerResource 168public static IResourceBuilder<T> WithImage<T>(this IResourceBuilder<T> builder, string image, string tag = "latest") where T : ContainerResource 194public static IResourceBuilder<T> WithImageSHA256<T>(this IResourceBuilder<T> builder, string sha256) where T : ContainerResource 218public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, params string[] args) where T : ContainerResource 235public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Action<ContainerRuntimeArgsCallbackContext> callback) where T : ContainerResource 257public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource 284public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource 291private static IResourceBuilder<T> ThrowResourceIsNotContainer<T>(IResourceBuilder<T> builder) where T : ContainerResource 301public static IResourceBuilder<T> PublishAsContainer<T>(this IResourceBuilder<T> builder) where T : ContainerResource 311/// <typeparam name="T">Type parameter specifying any type derived from <see cref="ContainerResource"/>/</typeparam> 319/// When this method is called an annotation is added to the <see cref="ContainerResource"/> that specifies the context path and 345public static IResourceBuilder<T> WithDockerfile<T>(this IResourceBuilder<T> builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource 405public static IResourceBuilder<ContainerResource> AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null) 428public static IResourceBuilder<T> WithContainerName<T>(this IResourceBuilder<T> builder, string name) where T : ContainerResource 467public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, object value) where T : ContainerResource 518public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource 565public static IResourceBuilder<T> WithBuildSecret<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
Dashboard\DashboardLifecycleHook.cs (1)
145ContainerResource => KnownResourceTypes.Container,
Dcp\ApplicationExecutor.cs (1)
1736if (modelContainerResource is ContainerResource containerResource)
ParameterResourceBuilderExtensions.cs (1)
240where T : ContainerResource, IResourceWithConnectionString
Publishing\ManifestPublishingContext.cs (5)
99else if (resource is ContainerResource container) 249public async Task WriteContainerAsync(ContainerResource container) 299private void WriteBuildContext(ContainerResource container) 419(ContainerResource, _, null, int port) => port, 584private void WriteContainerMounts(ContainerResource container)
Aspire.Hosting.Azure.AppContainers (2)
AzureContainerAppContainerExtensions.cs (1)
34public static IResourceBuilder<T> PublishAsAzureContainerApp<T>(this IResourceBuilder<T> container, Action<AzureResourceInfrastructure, ContainerApp> configure) where T : ContainerResource
AzureContainerAppsInfrastructure.cs (1)
294(ContainerResource, _, null, int port) => port,
Aspire.Hosting.Dapr.Tests (4)
DaprTests.cs (4)
41var container = Assert.Single(model.Resources.OfType<ContainerResource>()); 140var container = Assert.Single(model.Resources.OfType<ContainerResource>());
Aspire.Hosting.MySql.Tests (1)
AddMySqlTests.cs (1)
230Assert.Single(builder.Resources.OfType<ContainerResource>().Where(resource => resource.Name is "mySql-phpmyadmin"));
Aspire.Hosting.Tests (1)
Dcp\ApplicationExecutorTests.cs (1)
809(Action<IResourceBuilder<ContainerResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [