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
ARG FUNCTION_RUNTIME | |
FROM mikesir87/aws-cli as code | |
ARG FUNCTION_NAME | |
ARG AWS_DEFAULT_REGION | |
ARG AWS_ACCESS_KEY_ID | |
ARG AWS_SECRET_ACCESS_KEY | |
RUN wget -O function.zip `aws lambda get-function --function-name $FUNCTION_NAME --query 'Code.Location' --output text` | |
RUN mkdir /function | |
RUN unzip function.zip -d /function | |
FROM lambci/lambda:$FUNCTION_RUNTIME | |
COPY --from=code /function /var/task |
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
docker build \ | |
--build-arg AWS_DEFAULT_REGION=us-west-2 \ | |
--build-arg AWS_ACCESS_KEY_ID=AKIAXXXXXXXX \ | |
--build-arg AWS_SECRET_ACCESS_KEY=XXXXXXXX \ | |
--build-arg FUNCTION_NAME=HelloWorld \ | |
--build-arg FUNCTION_RUNTIME=nodejs8.10 \ | |
-t helloworld \ | |
-f lambda2img.Dockerfile . | |
docker run helloworld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment