Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use minimal base image for lambda example #86

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Jul 8, 2023

It turns out the base image doesn't matter, so long as you invoke the handler using the aws-lambda-go handler wrapper

https://docs.aws.amazon.com/lambda/latest/dg/go-image.html#go-image-other describes using alpine as a base, but ko's default cgr.dev/chainguard/static works just as well.

This brings the image size from 112MB to 6MB 📉 (zero vulns either way)

Signed-off-by: Jason Hall <jason@chainguard.dev>
@imjasonh imjasonh requested a review from mattmoor July 8, 2023 00:46
@imjasonh imjasonh enabled auto-merge July 8, 2023 00:46
@imjasonh imjasonh merged commit 98f230d into ko-build:main Jul 8, 2023
Copy link
Contributor

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants