码头工人组成未知主机?

时间:2019-01-03 16:07:57

标签: docker docker-compose

我无法使用AWS开发工具包的putObject将文件上传到本地堆栈中的伪s3。尝试调用putObject时收到未知的主机异常。 SDK正在呼唤my-bucket.localstack:4572,但我的docker contains似乎无法解析请求,并引发未知的主机异常。是否有指向my-bucket.localstack:4572指向localstack的地方?

version: "3"
services:
  app:
    image: app:latest
    command: run
    networks:
      - mynetwork
    ports:
      - 8000:8080
    environment:
      - AWS_ACCESS_KEY_ID=111
      - AWS_SECRET_ACCESS_KEY=111
      - AWS_REGION=us-east-1
      - spring_profiles_active=local

  localstack:
    image: localstack/localstack
    networks:
      - mynetwork
    ports:
      - "4567-4584:4567-4584"
      - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
      - SERVICES=sqs,s3

networks:
  mynetwork:
    driver: bridge

1 个答案:

答案 0 :(得分:0)

配置AWS开发工具包以使用路径样式访问解决了我的问题。

请参阅以下Github问题:https://github.com/localstack/localstack/issues/43#issuecomment-308273958