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

reducing cURL dependency size #28

Closed
missinglink opened this issue Jun 17, 2021 · 3 comments
Closed

reducing cURL dependency size #28

missinglink opened this issue Jun 17, 2021 · 3 comments

Comments

@missinglink
Copy link

missinglink commented Jun 17, 2021

Heya,

I've been looking at reducing the size of images generated with this lib and found that 105M of the total 323M image size is being taken up by the curl-7.77.0 directory:

323M	/
105M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0

Within that dir there seem to be a bunch of files not required at runtime:

3.3M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/autom4te.cache
1.3M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/config.log
1.3M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/configure
6.7M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/docs
25M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/lib
3.3M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/projects
4.8M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/src
56M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0/tests

I'm assuming it's not safe to just delete /code/node_modules/aws-lambda-ric/deps/curl-7.77.0?
... but presumably we could ditch some dirs such as curl-7.77.0/tests and the cache/log/configure/docs etc. files?

@missinglink
Copy link
Author

missinglink commented Jun 17, 2021

The following command helps reduce the image size significantly:

# https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/issues/28
RUN rm -rf \
  node_modules/aws-lambda-ric/deps/curl-*/autom4te.cache \
  node_modules/aws-lambda-ric/deps/curl-*/config.log \
  node_modules/aws-lambda-ric/deps/curl-*/configure \
  node_modules/aws-lambda-ric/deps/curl-*/docs \
  node_modules/aws-lambda-ric/deps/curl-*/projects \
  node_modules/aws-lambda-ric/deps/curl-*/tests \
  node_modules/aws-lambda-ric/deps/curl-*/README
33M	/code/node_modules/aws-lambda-ric/deps/curl-7.77.0

@danwashusen
Copy link

This one seems pretty bonkers... Could it not just use a pre-installed libcurl and fail if its not available?

@krk
Copy link

krk commented Jun 23, 2023

This is fixed in #70.

@krk krk closed this as completed Jun 23, 2023
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

3 participants