-
-
Save lox/6a7e0d2a75b6acc4adbec1a2c06e927d to your computer and use it in GitHub Desktop.
Dockerfile and bash script that builds node-sass binaries for Alpine Linux
This file contains hidden or 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 hidden or 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