Skip to content

An AWS Lambda Layer for the Sharp node module. Automatically published on updates.

Notifications You must be signed in to change notification settings

bubblydoo/lambda-layer-sharp

 
 

Repository files navigation

AWS Lambda layer for Sharp

Releases Build Layer ZIP

This AWS Lambda layer contains a pre-built Sharp binary. New releases are automatically published in this repository on each Sharp update.

Download

A pre-built layer zip file is available on the Releases page, alongside the size of the layer. Zip files for both x86_64 and arm64 are available.

Build

Dependencies

  • Docker

Steps

  1. Clone the repo:
    git clone [email protected]:bubblydoo/lambda-layer-sharp.git
    cd lambda-layer-sharp/
  2. Install dependencies:
    docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm --no-optional --no-audit --progress=false install
  3. Build the layer:
    docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node ./node_modules/webpack/bin/webpack.js
  4. Perform a smoke-test:
    docker run -w /var/task/dist/nodejs -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node -e "console.log(require('sharp'))"
  5. Import created layer into your AWS account:
    aws lambda publish-layer-version --layer-name sharp --description "Sharp layer" --license-info "Apache License 2.0" --zip-file fileb://dist/sharp-layer.zip --compatible-runtimes nodejs12.x

Auto-publish

The build Github Action is automatically triggered by Dependabot, merged by Mergify and then published by the same Github Action.

Credits

Originally forked from Umkus/lambda-layer-sharp.

About

An AWS Lambda Layer for the Sharp node module. Automatically published on updates.

Topics

Resources

Stars

Watchers

Forks

Languages

  • JavaScript 77.3%
  • Dockerfile 22.7%