Skip to content

Instantly share code, notes, and snippets.

@amrocha
Created July 11, 2016 23:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amrocha/d7328f2d637745597fb5f46aad32f327 to your computer and use it in GitHub Desktop.
Save amrocha/d7328f2d637745597fb5f46aad32f327 to your computer and use it in GitHub Desktop.
Dockerfile and bash script that builds node-sass binaries for Alpine Linux
#!/bin/bash
versions=( 0.10 0.12 4 5 6 )
for i in "${versions[@]}"
do
echo $i
sed -i '' "s/FROM.*/FROM mhart\/alpine-node:$i/" Dockerfile
docker build --tag node-sass-binaries .
docker run node-sass-binaries cat /node-sass/binaries.tar.gz > "binary-$i.tar.gz"
done
#####
# Running:
# --------
# ./build.sh
#######
FROM mhart/alpine-node:6
### setup ###
RUN apk add --no-cache python=2.7.12-r0 git-perl bash make gcc g++
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
### 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