- NodeJS/NPM
- Docker
- Prepare the app code (ex : app.js)
- Add Dockerfile
- docker build -t aws-container-nodejs-hello .
- docker run -p 9000:8080 aws-container-nodejs-hello
Prerequisites:
- aws CLI
- docker
- aws credentials configured
- aws account id ( aws sts get-caller-identity )
- proper region set in ecr url / permissions
aws ecr create-repository --repository-name aws-container-nodejs-hello --image-scanning-configuration scanOnPush=true docker tag aws-container--nodejs-hello:latest <aws_account_id>.dkr.ecr..amazonaws.com/aws-container-nodejs-hello:latest aws ecr get-login-password | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr..amazonaws.com docker push <aws_account_id>.dkr.ecr..amazonaws.com/aws-container-nodejs-hello:latest
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
"no basic auth credentials" during ECR push means wrong region in login or push command or wrong combination of both
Creating Lambda function with container support :
Read article on Medium Links :
https://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors-docker.html