[英]docker-compose unknown host?
I can not use the AWS SDK putObject to upload a file to a fake s3 in local stack.我无法使用 AWS SDK putObject 将文件上传到本地堆栈中的假 s3。 I get an unknown host exception when I try to call putObject.
当我尝试调用 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. SDK 正在调用
my-bucket.localstack:4572
但my-bucket.localstack:4572
似乎无法解析请求并引发未知主机异常。 Is there away to point my-bucket.localstack:4572
to localstack?是否可以将
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
Configuring the AWS SDK to use path style access resolved my problem.将 AWS 开发工具包配置为使用路径样式访问解决了我的问题。
See this Github issue: https://github.com/localstack/localstack/issues/43#issuecomment-308273958请参阅此 Github 问题: https : //github.com/localstack/localstack/issues/43#issuecomment-308273958
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.