Freid001
Freid001

Reputation: 2850

docker-compose unknown host?

I can not use the AWS SDK putObject to upload a file to a fake s3 in local stack. I get an unknown host exception when I try to call putObject. The SDK is calling out to my-bucket.localstack:4572 but my docker contain does not seem to be able to resolve the request and throws a unknown host exception. Is there away to point my-bucket.localstack:4572 to 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

Upvotes: 2

Views: 1189

Answers (1)

Freid001
Freid001

Reputation: 2850

Configuring the AWS SDK to use path style access resolved my problem.

See this Github issue: https://github.com/localstack/localstack/issues/43#issuecomment-308273958

Upvotes: 2

Related Questions