Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
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
You can’t perform that action at this time.