Skip to content

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

@prcongithub

Description

@prcongithub

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions