[[Docker Compose]]を使う。
`docker-compose.yml`
```yaml
version: '3'
services:
s3:
image: localstack/localstack:latest
hostname: s3
ports:
- "4566:4566"
networks: # AWS SAMと連携する場合は必須の設定 (<yourbucket>がバケット名)
default:
aliases:
- s3.localhost.localstack.cloud
- s3-website.localhost.localstack.cloud
- <yourbucket>.s3.localhost.localstack.cloud
- <yourbucket>.s3-website.localhost.localstack.cloud
environment:
SERVICES: s3
DEFAULT_REGION: ap-northeast-1
DEBUG: "1"
expose:
- "4566"
```
## 参考
- [Support for s3 bucket subdomains · Issue \#2631 · localstack/localstack](https://github.com/localstack/localstack/issues/2631#issuecomment-826867596)