Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build a node lambda function for
#!/bin/bash
# If you are developing on OSX on Windows
# but you want to run on linux - or in docker - or on AWS Lambda
# PhantomJS must be the binary for that OS...
# https://github.com/sindresorhus/pageres/issues/275
#
# Easiest solution, download inside a docker, running on linux
#
# This script should be run from within the docker container
#
# Usage
# ---------
# docker run -it -v `pwd`:/app node:latest /app/buildPhantomJSAsLinux-InDocker.sh
#
# when it exits, docker exits.
set -e
echo "building in docker"
cd /app
rm -rf node_modules/phantomjs-prebuilt/
npm install
#!/bin/bash
# If you are developing on OSX on Windows
# but you want to run on linux - or in docker - or on AWS Lambda
# PhantomJS must be the binary for that OS...
# https://github.com/sindresorhus/pageres/issues/275
#
# Easiest solution, download inside a docker, running on linux
#
# 1. install docker
# 2. Run this script, located as a sibling of your package.json file
set -e
docker run -it \
-v `pwd`:/app \
node:latest \
/app/buildPhantomJSAsLinux-InDocker.sh
@ykessler
Copy link

ykessler commented Nov 24, 2018

Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment