Skip to content

Instantly share code, notes, and snippets.

@amrocha
Last active December 5, 2016 05:24
Show Gist options
  • Save amrocha/56ffd0246a8bf31b72ae4667fbd1ea99 to your computer and use it in GitHub Desktop.
Save amrocha/56ffd0246a8bf31b72ae4667fbd1ea99 to your computer and use it in GitHub Desktop.
Dockerfile that compiles node-sass binaries in Alpine for 64-bit iojs v1
#####
# Running:
# --------
# docker build --tag node-sass-binaries .
# docker run node-sass-binaries cat /node-sass/binaries.tar.gz > binaries.tar.gz
#######
FROM alpine:3.3
### setup ###
RUN apk add --no-cache python=2.7.11-r3 curl wget git-perl bash make gcc g++ linux-headers libgcc libstdc++
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
### install node version from source ###
### substitute the 4 in `make -j4` for the number of cores your docker has
RUN cd /tmp && \
wget https://iojs.org/dist/v1.8.4/iojs-v1.8.4.tar.gz && \
tar -xzvf iojs-v1.8.4.tar.gz &&\
cd iojs-v1.8.4 && \
./configure &&\
make -j4 &&\
make install &&\
node -v
### get node-sass ###
RUN git clone https://github.com/sass/node-sass --recursive
WORKDIR /node-sass
### build the binaries ###
RUN echo "v3.7.0"
RUN rm -rf vendor
RUN git fetch
RUN git checkout v3.7.0
RUN git submodule update --init --recursive
RUN npm install --verbose
RUN node scripts/build.js -f --verbose
### place binaries in vendor folder ###
RUN ls -lsa vendor
RUN tar -cvzf binaries.tar.gz vendor/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment