miniblue

moabukarMIT活跃维护

单二进制本地 Azure 模拟器,无需账号即可跑起 25+ 项 Azure 服务,方便本地开发和 CI 里测试云资源相关代码。

Local Azure development. One binary. No account needed. 25+ emulated services for testing, CI and local dev.

v0.8.0发布于 2026-06-21 22:23 UTC451star +1 / 7 天58fork同步于 2026-11-10 23:57 UTC

怎么上手

由 README 提炼,执行前请确认
brew tap moabukar/tap && brew install miniblue
docker run -p 4566:4566 -p 4567:4567 moabukar/miniblue:latest
硬件要求按 README 说明

README 未说明硬件要求;提供约 8MB 的 Docker 镜像,可本地运行,未提及 GPU 或显存需求。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

单二进制本地模拟 28 个 Azure 服务,无需账号即可开发和测试 Azure 应用

单二进制本地 Azure 模拟器,无需账号即可跑起 25+ 项 Azure 服务,方便本地开发和 CI 里测试云资源相关代码。

核心能力

  • 单端口模拟 28 个 Azure 服务
  • 兼容 Terraform、Pulumi、Azure SDK 和 curl
  • 可选接入真实 Postgres、Redis 和 Docker 后端
  • 支持文件持久化与 Postgres 持久化
  • 用 SERVICES 环境变量按需启用服务

容易踩的坑

默认 moabukar/miniblue:latest 镜像基于 FROM scratch,不含 docker CLI,使用真实 Docker/k3s 后端需改用二进制安装或 full 构建目标;Terraform 使用前需先执行 scripts/trust-cert.sh 信任证书;默认 HTTP 端口 4566、HTTPS 端口 4567,Terraform 的 metadata_host 需指向 localhost:4567。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.8.0
  1. v0.8.0最新正式版2026-06-21 · 2026-06-21 22:23 UTC

    New: Virtual Machines (Microsoft.Compute/virtualMachines)

    Full VM lifecycle backed by real Docker containers, plus multi-service deployment, log streaming, run-command, interactive SSH and managed-identity attestation. miniblue now emulates 28 Azure services.

    Virtual Machines

    • Create, list, start, stop, restart and delete VMs via the ARM API and azlocal vm, each backed by a Docker container on a per-VM network (ACI-style stub mode when Docker is absent)
    • Deploy multiple named services per VM (azlocal vm deploy), each in its own container with host-published ports and port-conflict detection
    • Read per-service or combined labelled logs with tail and follow (azlocal vm logs)
    • Run one-off commands (azlocal vm run-command, mirrors Azure runCommand) or open an interactive shell (azlocal vm ssh)
    • A VM whose container fails to start fails fast with ContainerStartFailed and persists nothing

    Managed identities

    • User-assigned managed identities (Microsoft.ManagedIdentity/userAssignedIdentities) with azlocal identity CRUD
    • Assign identities to VMs (azlocal vm identity-assign); workloads inside a VM obtain attestation tokens with no code changes via the standard IDENTITY_ENDPOINT / IDENTITY_HEADER protocol
    • Tokens carry xms_mirid and VM claims, verifiable via POST /metadata/identity/introspect

    Other

    • Java SDK example covering Resource Groups, Key Vault, Blob Storage and Cosmos DB (#122)
    • Website docs page for Virtual Machines, wired into the nav, services overview and the API parity matrix
    • Dependency updates: go-chi/chi v5.3.0, testcontainers-go v0.43.0, alpine 3.24, actions/checkout v7

    Full changelog: https://github.com/moabukar/miniblue/blob/main/CHANGELOG.md

  2. v0.7.02026-05-02 · 2026-05-02 01:28 UTC
    查看更新说明

    New: Microsoft.Resources/deployments Phase 1 (#118)

    az deployment group create --template-file main.bicep now works end to end against miniblue.

    What's in Phase 1

    • PUT/GET/DELETE/List on Microsoft.Resources/deployments
    • Walks template.resources in declaration order
    • Resolves [parameters('x')] and [variables('x')] (with defaultValue fallback)
    • Dispatches each resource through the embedded chi router so existing service handlers apply it
    • Per-resource error surfaced as a Failed deployment with details

    Not yet supported (deferred)

    • Other template functions: [concat()], [resourceId()], [reference()], [copyIndex()], etc.
    • copy loops
    • condition on resources
    • Nested templates and module references
    • dependsOn ordering (resources are applied in declaration order)
    • outputs evaluation
    • Subscription, management-group, or tenant-scope deployments
    • What-If and Validate operations

    See examples/bicep/ for a working sample plus the deferred list.

    Helm / Kubernetes deployment guide (#117, closes #86)

    New page at https://miniblue.io/guides/helm covering helm install, persistence, PostgreSQL backend via secret, exposing the service, and the in-cluster real-backend limitations.

    SHA256SUMS for release binaries (#115, closes #94)

    The release workflow now publishes a single SHA256SUMS asset alongside the binaries:

    sha256sum -c SHA256SUMS --ignore-missing
    

    Other

    • New AKS CI job that exercises the :full Docker image with a mounted docker socket (#114)
    • CHANGELOG backfilled for v0.4.2 through v0.6.0 from each release's notes (#116)
    • README comparison table service count corrected 26 → 27

    Upgrading

    docker pull moabukar/miniblue:0.7.0
    brew upgrade miniblue
    

    Try Bicep:

    azlocal group create --name bicep-rg --location eastus
    az deployment group create --resource-group bicep-rg \
      --template-file examples/bicep/main.bicep \
      --parameters saName=mystorage clusterName=mycluster
    
  3. v0.6.02026-05-01 · 2026-05-01 18:40 UTC
    查看更新说明

    New: Azure Kubernetes Service (AKS) emulation (#111, closes #50)

    Microsoft.ContainerService/managedClusters ARM management plane with two backends:

    BackendWhenWhat works
    stub (default)alwaysterraform apply, az aks list, azlocal aks ..., mock kubeconfig (kubectl will not connect)
    real (k3s in Docker)AKS_BACKEND=k3s + Docker daemoneverything above + a real rancher/k3s cluster per AKS resource; kubectl apply actually deploys pods

    Mirrors the ACI Docker pattern, so users do not need to install k3d / kind / minikube.

    CLI

    azlocal aks create --resource-group RG --name N [--node-count 1] [--kubernetes-version 1.30.0]
    azlocal aks list   --resource-group RG
    azlocal aks show   --resource-group RG --name N
    azlocal aks delete --resource-group RG --name N
    azlocal aks get-credentials --resource-group RG --name N [--file PATH|-] [--overwrite-existing]
    

    get-credentials defaults to merging into ~/.kube/config like real az aks does.

    Lifecycle coverage

    TriggerCleanup behavior
    terraform destroy / azlocal aks delete / direct DELETEcontainer removed immediately
    Resource group cascade deleteevery cluster's container in that RG removed
    miniblue SIGTERM / SIGINT / docker stopevery running k3s container torn down before miniblue exits
    miniblue SIGKILL / OOM / crashnext start with AKS_BACKEND=k3s reaps orphans
    PERSISTENCE=1 restartmatching containers preserved; same kubeconfig still works

    New full Docker image variant

    Default moabukar/miniblue:latest stays scratch (~9MB). Real-backend users (ACI, AKS) can build the full target which adds the docker CLI:

    docker build --target=full -t miniblue:full .
    docker run -v /var/run/docker.sock:/var/run/docker.sock \
      -p 4566:4566 -p 4567:4567 -e AKS_BACKEND=k3s miniblue:full
    

    Other changes

    • New dedicated CI pipeline .github/workflows/aks-e2e.yml that runs Terraform apply against the AKS example and a real-backend k3s smoke (DinD on the runner) on AKS-touching PRs and push to main
    • Resource group cascade delete now cleans up child AKS resources properly
    • cmd/miniblue graceful shutdown propagates to AKS so k3s containers do not leak past miniblue's lifetime
    • 27 services total (was 26); see azlocal health

    Upgrading

    docker pull moabukar/miniblue:0.6.0
    brew upgrade miniblue
    

    Try it:

    azlocal group create --name myRG --location eastus
    azlocal aks create --resource-group myRG --name dev --node-count 1
    azlocal aks list --resource-group myRG
    

    Known limitation

    The real backend always runs k3s v1.30.14. If you PUT a cluster with a different kubernetesVersion the ARM response will echo it back but kubectl version will report the actual k3s version (a WARNING log fires when this happens). Per-version k3s images is on the roadmap for v0.7.

  4. v0.5.12026-05-01 · 2026-05-01 13:28 UTC
    查看更新说明

    Bug fixes

    • Fix container startup crash on fresh Docker runs. The scratch-based image runs as USER 65534 but had no writable home directory, so miniblue tried to mkdir /.miniblue and failed with permission denied. The image now ships with /home/nonroot owned by 65534 and HOME set so the cert dir can be created cleanly. (#110)
    • Fix cert load when existing certs are unusable. When the cert directory existed but cert.pem/key.pem were missing, corrupted, or expired, miniblue would log.Fatal instead of regenerating. All those branches now fall through to generate a new cert. Thanks @KarasAlison. (#109)
    • Bump github.com/go-sql-driver/mysql to v1.10.0. (#108)

    CI

    • E2E now builds the image from the PR's Dockerfile instead of pulling :latest from Docker Hub, so regressions are actually caught on the PR that introduces them. Failed startups also dump docker logs miniblue for diagnostics. (#110)
    • Bump mislav/bump-homebrew-formula-action to v4. (#107)

    Upgrading

    docker pull moabukar/miniblue:0.5.1
    # or
    brew upgrade miniblue
    
  5. v0.5.02026-04-21 · 2026-04-21 12:41 UTC
    查看更新说明

    New Azure Services

    App Service & Web Apps (#103)

    Full emulation of Azure App Service resources, contributed by @abusarah-tech:

    • Web Apps (Microsoft.Web/sites) — CRUD, slots, publishing credentials, config sub-resources (app settings, auth settings v1/v2, connection strings, backup, logs, metadata, push settings, slot config names, storage accounts)
    • App Service Plans (Microsoft.Web/serverFarms) — CRUD with SKU tier detection
    • Container Apps (Microsoft.App/containerApps) — CRUD, start/stop, revisions, secrets, auth tokens, custom domain analysis, subscription-level listing
    • Managed Environments (Microsoft.App/managedEnvironments) — CRUD with app logs configuration
    • Container App Jobs (Microsoft.App/jobs) — CRUD, start/stop, executions, detectors, secrets
    • Name Availability — CheckNameAvailability endpoint for sites
    • azlocal CLI — New containerapp and containerapp env commands
    • Terraform examples — New containerapps and webapps scenarios

    The existing Azure Functions emulation has been refactored into the broader sites package.

    Bug Fixes

    Cert/key loading error handling (#105)

    Improved error handling when loading existing TLS certificates and keys, giving clearer error messages when files are corrupted or unreadable. Fixes #104.

    Full Changelog: https://github.com/moabukar/miniblue/compare/v0.4.4...v0.5.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Disclaimer: miniblue is an independent open-source project. It is not affiliated with, endorsed by, or associated with Microsoft or Azure.


    Quick Start

    # Homebrew
    brew tap moabukar/tap && brew install miniblue
    
    # Or Docker
    docker run -p 4566:4566 -p 4567:4567 moabukar/miniblue:latest
    

    Then interact with it:

    azlocal health
    azlocal group create --name myRG --location eastus
    azlocal keyvault secret set --vault myvault --name db-pass --value secret123
    azlocal storage blob upload --account myacct --container data --name file.txt --data "Hello!"
    

    No Azure account or credentials needed.

    What it does

    28 Azure services emulated behind a single port. Works with Terraform, Pulumi, Azure SDKs, and curl.

    ServiceServiceService
    Resource GroupsBlob StorageTable Storage
    Queue StorageKey VaultCosmos DB
    Service BusAzure FunctionsVirtual Networks
    DNS ZonesContainer RegistryEvent Grid
    App ConfigurationManaged IdentityDB for PostgreSQL
    DB for MySQLAzure SQL DatabaseAzure Cache for Redis
    Container InstancesKubernetes Service (AKS)Public IP Addresses
    Network Security GroupsLoad BalancerApplication Gateway
    Storage AccountsVirtual Machines

    How it compares

    LocalStack (AWS)MiniStack (AWS)Azurite (Azure)miniblue
    Services80+363 (storage only)28
    Docker image~1GB~200MB~300MB~8MB
    Startup~10s~5s~3s<1s
    Real backendsDynamoDB LocalRDS, S3, SQSNoPostgres, Redis, Docker
    TerraformYesYesNoYes
    LicenseBSLMITMITMIT

    Terraform

    https://github.com/user-attachments/assets/eea72535-6eb7-419d-9f9c-6f42b80d5efc

    bash scripts/trust-cert.sh  # one-time cert trust
    
    provider "azurerm" {
      features {}
      metadata_host              = "localhost:4567"
      skip_provider_registration = true
      subscription_id            = "00000000-0000-0000-0000-000000000000"
      tenant_id                  = "00000000-0000-0000-0000-000000000001"
      client_id                  = "miniblue"
      client_secret              = "miniblue"
    }
    

    See examples/terraform/ for full examples including three-tier, serverless, and microservices scenarios.

    Real Backends (optional)

    FeatureEnv var
    Real PostgreSQL databasesPOSTGRES_URL=postgres://user:pass@host:5432/db
    Real Redis connectivityREDIS_URL=redis://host:6379
    Real Docker containers (ACI)Docker daemon running
    Real k3s cluster per AKS resourceAKS_BACKEND=k3s (Docker daemon required)
    File persistencePERSISTENCE=1
    Postgres persistenceDATABASE_URL=postgres://...

    Real backends shell out to the host Docker daemon. The default moabukar/miniblue:latest image is FROM scratch and has no docker CLI, so use the binary install (Homebrew, releases page) or the full Docker target which adds it:

    docker build --target=full -t miniblue:full .
    docker run -v /var/run/docker.sock:/var/run/docker.sock \
      -p 4566:4566 -p 4567:4567 \
      -e AKS_BACKEND=k3s miniblue:full
    

    miniblue tears down its k3s containers on graceful shutdown (SIGTERM/SIGINT/docker stop); orphans from a forced kill are reaped by the next start.

    Configuration

    VariableDefaultDescription
    PORT4566HTTP port
    TLS_PORT4567HTTPS port
    LOG_LEVELinfodebug, info, warn, error
    SERVICESallComma-separated list to enable selectively
    PERSISTENCEoffSet to 1 for file-based persistence

    Full configuration reference in the docs.

    Documentation

    Full docs at miniblue.io covering:

    Contributing

    See CONTRIBUTING.md. Each service is its own Go package under internal/services/.

    Sponsors

    miniblue is sponsored by CoderCo.

    Want to sponsor this project? Reach out at [email protected].

    License

    MIT - see LICENSE.