Run AWS SAM without fixing your local python first
983
Running AWS SAM requires a specific version of Python in perfect conditions. That's not always an option.
To have SAM work reliably on every machine, this package makes it available to run in docker. SAM however requires docker itself to operate, so there are a few caveats to this.
--privileged)-v /var/run/docker.sock:/var/run/docker.sock)### /app This is where your template.yml should be, and all the code it needs to serve
This is where you can mount your ~/.aws/credentials, so the AWS_PROFILE environment parameter could be meaningful
Running in Docker Compose with Dynamo DB to locally test Lambda functions
docker-compose.yml
version: "3"
services:
dynamodb:
image: dwmkerr/dynamodb
ports:
- 8000:8000
volumes:
- ./db:/data
command: -dbPath /data
python:
image: vsbmeza/sam
volumes:
- ./:/app
- /var/run/docker.sock:/var/run/docker.sock
- ~/.aws/credentials:/root/.aws/credentials
ports:
- 3001:3001
environment:
PORT: 3001
AWS_PROFILE: ${AWS_PROFILE}
privileged: true
links:
- dynamodb
Content type
Image
Digest
Size
288.8 MB
Last updated
over 6 years ago
docker pull vsbmeza/sam