Last active
November 23, 2023 14:07
-
-
Save Tranquility2/b6013ad323bcb6ef8f6781a7f7e9a307 to your computer and use it in GitHub Desktop.
Run and test aws container based lambdas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE_IMAGE_NAME="new_lambda" | |
CONTAINER_NAME="${BASE_IMAGE_NAME}_container" | |
IMAGE_WITH_TAG="${BASE_IMAGE_NAME}:test" | |
docker build . -t ${IMAGE_WITH_TAG} | |
docker run -d -p 9000:8080 --name ${CONTAINER_NAME} ${IMAGE_WITH_TAG} | |
result=$(curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}') | |
jq . <<< "$result" | |
docker stop ${CONTAINER_NAME} | |
docker rm ${CONTAINER_NAME} | |
docker rmi ${IMAGE_WITH_TAG} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment