Skip to content

Instantly share code, notes, and snippets.

@neilstuartcraig
Created October 17, 2016 21:10
Show Gist options
  • Save neilstuartcraig/bd3f7010bae42292bc90d22f5773bae8 to your computer and use it in GitHub Desktop.
Save neilstuartcraig/bd3f7010bae42292bc90d22f5773bae8 to your computer and use it in GitHub Desktop.
Compiling Node.JS on Alpine Linux
apk update
apk install curl python build-base gcc abuild binutils binutils-doc gcc-doc linux-headers
curl -L -O https://nodejs.org/dist/v4.6.0/node-v4.6.0.tar.gz
tar xzf node-v4.6.0.tar.gz
cd node-v4.6.0
./configure
make
make install
@duhaime
Copy link

duhaime commented Mar 27, 2018

This wouldn't book on my Amazon Linux container, but a slightly modified version would:

RUN NODE_VERSION="v9.9.0" && \
    apk add --update --no-cache curl \
    make \
    python \
    g++ \
    gcc \
    gcc-doc \
    linux-headers && \
  curl -L -O https://nodejs.org/dist/latest-v9.x/node-$NODE_VERSION.tar.gz && \
  tar xzf node-$NODE_VERSION.tar.gz && \
  cd node-$NODE_VERSION && \
  ./configure && \
  make && \
  make install

@souparno
Copy link

how to download npm? also, does node-gyp needs to be built as well?

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