Skip to content

Commit

Permalink
Upgrade to Node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
hansottowirtz committed Feb 16, 2024
1 parent dc8a1fa commit ea641fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM amazonlinux:2-with-sources

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
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,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"
}
}

0 comments on commit ea641fc

Please sign in to comment.