最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Azure Storage SImulator azurite not binding to 127.0.0.1 in docker - Stack Overflow

programmeradmin1浏览0评论

My local (windows) azure function works fine when I start azurite in windows and use UseDevelopmentStorage=true. I can connect to the port with telnet localhost 10000 and telnet 127.0.0.1 10000.

However, when I stop azurite on windows and run it in WSL via docker the function cannot connect.

Azure.Core: No connection could be made because the target machine actively refused it. (127.0.0.1:10000). System.Net.Http: No connection could be made because the target machine actively refused it. (127.0.0.1:10000). System.Net.Sockets: No connection could be made because the target machine actively refused it.

The port is definitely open but telnet on 127.0.0.1 confirms that that binding is missing:

  • telnet localhost 10000
  • telnet 127.0.0.1 10000

What most be changed in docker(-compose) so that binding to 127.0.0.1 works? OR How can I tell my azure function to connect to localhost or 0.0.0.0 instead of 127.0.0.1?

docker describe azurite

 "Ports": {
  "10000/tcp": [
      {
          "HostIp": "0.0.0.0",
          "HostPort": "10000"
      },
      {
          "HostIp": "::",
          "HostPort": "10000"
      }
  ],

docker compose

name: microsoft-azure-eventhubs
services:
  azurite:
    container_name: "azurite"
    image: "mcr.microsoft/azure-storage/azurite:latest"
    ports:
      - "10000:10000"
      - "10001:10001"
      - "10002:10002"
    restart: unless-stopped
    networks:
      eh-emulator:
        aliases:
          - "azurite"
发布评论

评论列表(0)

  1. 暂无评论