Skip to content

Instantly share code, notes, and snippets.

@danielgormly
Created March 5, 2018 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgormly/7ccedea38919f0cbedfca0ecac862f6a to your computer and use it in GitHub Desktop.
Save danielgormly/7ccedea38919f0cbedfca0ecac862f6a to your computer and use it in GitHub Desktop.
Amazon Linux NPM Install
rm -rf node_modules/sharp
docker build -t awslinux-npm ./awslinux-npm
docker run -v "$PWD":/var/task awslinux-npm npm install
FROM amazonlinux
ENV VERSION="8.9.4"
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
&& [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" \
&& nvm install $VERSION
ENV PATH="${NVM_DIR}/versions/node/v${VERSION}/bin:${PATH}"
WORKDIR /var/task
@danielgormly
Copy link
Author

This script runs npm install on awslinux for local building for the purpose of remote pushing

project-name
--package.json
--awslinux-build.sh
--/awslinux-npm
----Dockerfile

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