Repository navigation
Conversation
Install azure-cli from Microsoft's apt repo. Inside the container, *.localhost.localstack.cloud names resolve to the container itself, and --add-host cannot cover the emulator's per-account storage hosts, so the server forwards 127.0.0.1:<LOCALSTACK_PORT> to LOCALSTACK_HOSTNAME when it runs in a container with LocalStack elsewhere. Document the Azure CLI in the image and add an Azure scenario to the Docker validation harness (group, storage account, blob upload). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The image ships the Azure CLI, so
localstack-azure-clientworks from Docker instead of answering thatazis missing.Installing
azisn't enough by itself. Inside the container, every*.localhost.localstack.cloudname resolves to127.0.0.1, which is the container itself. The emulator gives each storage account its own host (<account>.blob.core.azure.localhost.localstack.cloud), and--add-hostcan't list arbitrary account names. So the server now forwards its loopback gateway port to LocalStack:sequenceDiagram participant az as az (in MCP container) participant fwd as 127.0.0.1:4566 forwarder participant LS as LocalStack (host.docker.internal:4566) az->>fwd: TLS to acct.blob.core.azure.localhost.localstack.cloud fwd->>LS: raw TCP pipe (SNI and cert unchanged) LS-->>az: responsesrc/cli/index.ts (default: start server) exitWhenClientDisconnects() + forwardLoopbackGateway() # only in a container (/.dockerenv) with a non-local LOCALSTACK_HOSTNAME require("./stdio.js")Evidence
az, so the Azure tool returns "azis not available" in Docker.After: 409/409 unit tests pass, including the new forwarder tests:
127.0.0.1for a blob hostname reached a stub on another interface and returned its body ("ok").azureharness scenario (no Docker daemon here). The Docker workflow's integration step runs the scenario once this PR targetsmain. It uses the sameLOCALSTACK_AUTH_TOKENas the Azure smoke workflow, which needs LocalStack for Azure. Without that license, the scenario reports a WARN instead of failing.Merge Danger
Door: two-way
Blast Radius: Docker image
LOCALSTACK_HOSTNAME, and binds only127.0.0.1:<LOCALSTACK_PORT>, where nothing listened before. npx and from-source runs are unaffected. A taken port (--network host) means no forwarding, and nothing crashes.🤖 Generated with Claude Code