Created
July 11, 2016 23:13
-
-
Save amrocha/d7328f2d637745597fb5f46aad32f327 to your computer and use it in GitHub Desktop.
Dockerfile and bash script that builds node-sass binaries for Alpine Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
# 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