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

[SUGGESTION] Removing lib before make deploy could reduce size of the layer drastically #33

Open
prcongithub opened this issue Nov 17, 2020 · 0 comments

Comments

@prcongithub
Copy link

I tried this in my app but the size of the function was exceeding 262MB limit. So I dug deeper into the Makefile to see what all it includes in the final layer.zip. I saw that the lib, etc, include and share directories along with the bin folder were included. I wondered if we really needed those and tried this:

build/layer.zip: result/bin/identify build
	# imagemagick has a ton of symlinks, and just using the source dir in the template
	# would cause all these to get packaged as individual files. 
	# (https://github.com/aws/aws-cli/issues/2900) 
	#
	# This is why we zip outside, using -y to store them as symlinks
	
	cd result && rm -rf lib && zip -ry $(PROJECT_ROOT)$@ *

With this the size of the result folder was brought down to 19 MB from 55 MB.
This seems to be working fine with the function I use it in.

Any thoughts?

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

No branches or pull requests

1 participant