Skip to content

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions