BCat.Hosting.MinIO
8.2.2
dotnet add package BCat.Hosting.MinIO --version 8.2.2
NuGet\Install-Package BCat.Hosting.MinIO -Version 8.2.2
<PackageReference Include="BCat.Hosting.MinIO" Version="8.2.2" />
paket add BCat.Hosting.MinIO --version 8.2.2
#r "nuget: BCat.Hosting.MinIO, 8.2.2"
// Install BCat.Hosting.MinIO as a Cake Addin #addin nuget:?package=BCat.Hosting.MinIO&version=8.2.2 // Install BCat.Hosting.MinIO as a Cake Tool #tool nuget:?package=BCat.Hosting.MinIO&version=8.2.2
Aspire.Hosting.MinIO
MinIO integration for .NET Aspire applications. This package provides a simple way to add MinIO, an S3-compatible object storage server, to your Aspire application for managing object storage in development and production environments.
Installation
In your AppHost project, install the .NET Aspire MinIO Hosting library with NuGet:
dotnet add package BCat.Hosting.MinIO
Usage
In your Program.cs
or Aspire host project:
var builder = DistributedApplication.CreateBuilder(args);
// Simple usage with default credentials
var minio = builder.AddMinIO("storage");
// With custom configuration
var minio = builder.AddMinIO("storage", options => options
.WithPorts(apiPort: 9000, consolePort: 9001)
.WithCredentials("myaccesskey", "mysecretkey")
.WithDataVolume("/data/minio"));
// Reference in other projects
var api = builder.AddProject<Projects.MyApiProject>("api")
.WithReference(minio);
// Access connection string in dependent projects
builder.AddProject<Projects.MyApiProject>("api")
.WithReference(minio => minio
.WithEnvironment("Storage__ConnectionString", minio.GetConnectionString()));
Configuration Options
Ports
ApiPort
: The port for the MinIO API server (default: 9000)ConsolePort
: The port for the MinIO Console UI (default: 9001)
Authentication
AccessKey
: Root user access key (default: "minioadmin")SecretKey
: Root user secret key (default: "minioadmin")
Storage
DataVolumePath
: Local path to persist MinIO data
Connection String Format
The connection string format is:
http://{host}:{port};AccessKey={accessKey};SecretKey={secretKey}
Endpoints
The MinIO container exposes two endpoints:
- API endpoint (default: 9000) - Used for S3 API operations
- Console endpoint (default: 9001) - Web UI for managing buckets and objects
Examples
Basic Configuration with AWS SDK
// In your service project
var options = new AmazonS3Config
{
ServiceURL = Configuration["Storage:ConnectionString"],
ForcePathStyle = true
};
var credentials = new BasicAWSCredentials(
Configuration["Storage:AccessKey"],
Configuration["Storage:SecretKey"]);
services.AddSingleton<IAmazonS3>(_ =>
new AmazonS3Client(credentials, options));
Using with MinIO Client
// In your service project
services.AddMinio(options =>
{
options.EndPoint = Configuration["Storage:Host"];
options.AccessKey = Configuration["Storage:AccessKey"];
options.SecretKey = Configuration["Storage:SecretKey"];
options.UseSSL = false;
});
Default Credentials
If not specified, MinIO uses these default credentials:
- Access Key:
minioadmin
- Secret Key:
minioadmin
Docker Image
This integration uses the official MinIO Docker image:
- Registry:
docker.io
- Image:
minio/minio
- Tag:
latest
Contributing
Issues and pull requests are welcome at https://github.com/dotnet/aspire
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Aspire.Hosting (>= 8.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.2.2 | 96 | 11/2/2024 |