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

Node 18 #37

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM amazonlinux:2-with-sources
FROM public.ecr.aws/amazonlinux/amazonlinux:2023

ENV NODE_OPTIONS=--openssl-legacy-provider

WORKDIR /build

RUN curl --silent --location https://rpm.nodesource.com/setup_16.x | bash -
RUN curl --silent --location https://rpm.nodesource.com/setup_18.x | bash -

RUN yum -y install nodejs

Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ This AWS Lambda layer contains a pre-built [Sharp](https://www.npmjs.com/package

A pre-built layer zip file is available on the [Releases page](https://github.com/bubblydoo/lambda-layer-sharp/releases), alongside the size of the layer. Zip files for both x86_64 and arm64 are available.

## Compatibility

All versions above and including 0.33.0 are only compatible with Amazon Linux 2023 and Node.js 20 or above.

## Build

### Dependencies
Expand All @@ -22,21 +26,7 @@ A pre-built layer zip file is available on the [Releases page](https://github.co
git clone [email protected]:bubblydoo/lambda-layer-sharp.git
cd lambda-layer-sharp/
```
1. Install dependencies:
```sh
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm --no-optional --no-audit --progress=false install
```
1. Build the layer:
```sh
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node ./node_modules/webpack/bin/webpack.js
```
1. Perform a smoke-test:
```sh
docker run -w /var/task/dist/nodejs -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node -e "console.log(require('sharp'))"
```
1. Import created layer into your AWS account:
```sh
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
1. Build a multi-architecture Docker image:
```

## Auto-publish
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"sharp": "latest"
},
"engines": {
"node": ">=12.14.0"
"node": ">=18.0.0"
},
"volta": {
"node": "16.16.0"
"node": "18.17.0"
}
}
Loading