Skip to content

Commit 3cb261b

Browse files
committed
Fixed readme with steps to build layer properly
1 parent 9092ab2 commit 3cb261b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ A pre-built layer zip file is available on the [Releases page](../../releases),
1818
```
1919
1. Install dependencies:
2020
```shell script
21-
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm --no-optional --no-audit --progress=false install
21+
docker run -v "$PWD":/var/task --entrypoint npm public.ecr.aws/lambda/nodejs:18 --no-audit --progress=false --arch=x64 --platform=linux ci
2222
```
2323
1. Build the layer:
2424
```shell script
25-
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node ./node_modules/webpack/bin/webpack.js
25+
docker run -v "$PWD":/var/task --entrypoint node public.ecr.aws/lambda/nodejs:18 ./node_modules/webpack/bin/webpack.js
2626
```
2727
1. Perform a smoke-test:
2828
```shell script
29-
docker run -w /var/task/dist/nodejs -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node -e "console.log(require('sharp'))"
29+
docker run -w /var/task/dist/nodejs -v "$PWD":/var/task --entrypoint node public.ecr.aws/lambda/nodejs:18 -e "console.log(require('sharp'))"
3030
```
3131
1. Import created layer into your AWS account:
3232
```shell script
33-
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
33+
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 nodejs14.x nodejs16.x nodejs18.x
3434
```

0 commit comments

Comments
 (0)