This is a modified version of Resizing Images with Amazon CloudFront & Lambda@Edge | AWS CDN Blog for my own use.
docker build --tag amazonlinux:nodejs . docker run --rm --volume ${PWD}/lambda/origin-response-function:/build amazonlinux:nodejs /bin/bash -c "source ~/.bashrc; npm init -f -y; npm install sharp --save; npm install --only=prod" zip contents in lambda\origin-response-function