# IContainerRuntime

- Kind: `interface`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Publishing`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Publishing/IContainerRuntime.cs)

Represents a container runtime (e.g., Docker, Podman) that can be used to build, tag, push, and manage container images.

## Definition

```csharp
namespace Aspire.Hosting.Publishing;

public interface IContainerRuntime
{
    // ...
}
```

## Properties

- [Name](/reference/api/csharp/aspire.hosting/icontainerruntime/properties.md#name) : `string` `abstract` `get` -- Gets the name of the container runtime.

## Methods

- [BuildImageAsync(string, string, ContainerImageBuildOptions?, Dictionary<string, string?>, Dictionary<string, BuildImageSecretValue>, string?, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#buildimageasync-string-string-containerimagebuildoptions-dictionary-string-string-dictionary-string-buildimagesecretvalue-string-cancellationtoken) : `Task` `abstract` -- Builds a container image from a Dockerfile.
- [CheckIfRunningAsync(CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#checkifrunningasync-cancellationtoken) : `Task<bool>` `abstract` -- Checks if the container runtime is running and available.
- [ComposeDownAsync(ComposeOperationContext, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#composedownasync-composeoperationcontext-cancellationtoken) : `Task` `abstract` -- Stops and removes compose services.
- [ComposeListServicesAsync(ComposeOperationContext, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#composelistservicesasync-composeoperationcontext-cancellationtoken) : `Task<IReadOnlyList<ComposeServiceInfo>>` `abstract` -- Lists the running services in a compose environment with their port mappings.
- [ComposeUpAsync(ComposeOperationContext, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#composeupasync-composeoperationcontext-cancellationtoken) : `Task` `abstract` -- Starts compose services in detached mode.
- [LoginToRegistryAsync(string, string, string, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#logintoregistryasync-string-string-string-cancellationtoken) : `Task` `abstract` -- Logs in to a container registry.
- [PushImageAsync(IResource, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#pushimageasync-iresource-cancellationtoken) : `Task` `abstract` -- Pushes a container image to a registry.
- [RemoveImageAsync(string, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#removeimageasync-string-cancellationtoken) : `Task` `abstract` -- Removes a container image.
- [TagImageAsync(string, string, CancellationToken)](/reference/api/csharp/aspire.hosting/icontainerruntime/methods.md#tagimageasync-string-string-cancellationtoken) : `Task` `abstract` -- Tags a container image with a new name.
