-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3High priority, do before Pri2 and Pri3doc-enhancementImprove the current content [org][type][category]Improve the current content [org][type][category]fundamentalsContent related to fundamentals.Content related to fundamentals.preview-6Used to track doc updates for preview 6 of .NET AspireUsed to track doc updates for preview 6 of .NET Aspire
Description
With dotnet/aspire#2737 we added support for WithContainerRunArgs to Aspire.Hosting. This can be used to pass arguments directly to the container host run command for advanced scenarios like adjusting CPU & memory limits, or enabling GPU access, e.g.:
// Add an ollama container
var ollama = builder.AddContainer("ollama", "ollama/ollama")
.WithBindMount("ollama", "/root/.ollama")
.WithBindMount("./ollamaconfig", "/usr/config")
.WithHttpEndpoint(port: 11434, targetPort: 11434, name: "ollama")
.WithEntrypoint("/usr/config/entrypoint.sh")
// Enable GPU support in Docker Desktop, i.e. https://docs.docker.com/desktop/gpu/
.WithContainerRunArgs("--gpus=all")
// Enable GPU support in Podman when not using Docker CLI emulation, i.e. https://github.com/containers/podman/issues/19005
// .WithContainerRunArgs("--device", "nvidia.com/gpu=all")
;Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3High priority, do before Pri2 and Pri3doc-enhancementImprove the current content [org][type][category]Improve the current content [org][type][category]fundamentalsContent related to fundamentals.Content related to fundamentals.preview-6Used to track doc updates for preview 6 of .NET AspireUsed to track doc updates for preview 6 of .NET Aspire