diff --git a/Dockerfile b/Dockerfile index 70b06ea..dfbfe83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index e2346a2..00c61f6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -22,21 +26,7 @@ A pre-built layer zip file is available on the [Releases page](https://github.co git clone git@github.com: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 diff --git a/package.json b/package.json index 61f5cf8..828fd84 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ "sharp": "latest" }, "engines": { - "node": ">=12.14.0" + "node": ">=18.0.0" }, "volta": { - "node": "16.16.0" + "node": "18.17.0" } }