Skip to content

Commit

Permalink
Try to download pre-built alpine binary before building
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Apr 24, 2019
1 parent 281e720 commit 49723d6
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 72 deletions.
42 changes: 30 additions & 12 deletions 10/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ FROM alpine:3.9

ENV NODE_VERSION 10.15.3

RUN addgroup -g 1000 node \
RUN ARCH= && alpineArch="$(arch)" \
&& case "${alpineArch##*-}" in \
x86_64) ARCH='x64';; \
i386) ARCH='x86';; \
*) ;; \
esac \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
curl \
gnupg \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
Expand All @@ -34,6 +33,23 @@ RUN addgroup -g 1000 node \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& ( \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
) || ( \
# backup build
apk add --no-cache --virtual .build-deps-full \
binutils-gold \
g++ \
gcc \
libgcc \
linux-headers \
make \
python \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
Expand All @@ -43,10 +59,12 @@ RUN addgroup -g 1000 node \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& apk del .build-deps-full \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
) \
&& apk del .build-deps

ENV YARN_VERSION 1.13.0

Expand Down
42 changes: 30 additions & 12 deletions 11/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ FROM alpine:3.9

ENV NODE_VERSION 11.14.0

RUN addgroup -g 1000 node \
RUN ARCH= && alpineArch="$(arch)" \
&& case "${alpineArch##*-}" in \
x86_64) ARCH='x64';; \
i386) ARCH='x86';; \
*) ;; \
esac \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
curl \
gnupg \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
Expand All @@ -34,6 +33,23 @@ RUN addgroup -g 1000 node \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& ( \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
) || ( \
# backup build
apk add --no-cache --virtual .build-deps-full \
binutils-gold \
g++ \
gcc \
libgcc \
linux-headers \
make \
python \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
Expand All @@ -43,10 +59,12 @@ RUN addgroup -g 1000 node \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& apk del .build-deps-full \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
) \
&& apk del .build-deps

ENV YARN_VERSION 1.15.2

Expand Down
42 changes: 30 additions & 12 deletions 12/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ FROM alpine:3.9

ENV NODE_VERSION 12.0.0

RUN addgroup -g 1000 node \
RUN ARCH= && alpineArch="$(arch)" \
&& case "${alpineArch##*-}" in \
x86_64) ARCH='x64';; \
i386) ARCH='x86';; \
*) ;; \
esac \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
curl \
gnupg \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
Expand All @@ -34,6 +33,23 @@ RUN addgroup -g 1000 node \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& ( \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
) || ( \
# backup build
apk add --no-cache --virtual .build-deps-full \
binutils-gold \
g++ \
gcc \
libgcc \
linux-headers \
make \
python \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
Expand All @@ -43,10 +59,12 @@ RUN addgroup -g 1000 node \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& apk del .build-deps-full \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
) \
&& apk del .build-deps

ENV YARN_VERSION 1.15.2

Expand Down
42 changes: 30 additions & 12 deletions 6/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ FROM alpine:3.9

ENV NODE_VERSION 6.17.1

RUN addgroup -g 1000 node \
RUN ARCH= && alpineArch="$(arch)" \
&& case "${alpineArch##*-}" in \
x86_64) ARCH='x64';; \
i386) ARCH='x86';; \
*) ;; \
esac \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
curl \
gnupg \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
Expand All @@ -34,6 +33,23 @@ RUN addgroup -g 1000 node \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& ( \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
) || ( \
# backup build
apk add --no-cache --virtual .build-deps-full \
binutils-gold \
g++ \
gcc \
libgcc \
linux-headers \
make \
python \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
Expand All @@ -43,10 +59,12 @@ RUN addgroup -g 1000 node \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& apk del .build-deps-full \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
) \
&& apk del .build-deps

ENV YARN_VERSION 1.15.2

Expand Down
42 changes: 30 additions & 12 deletions 8/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ FROM alpine:3.9

ENV NODE_VERSION 8.16.0

RUN addgroup -g 1000 node \
RUN ARCH= && alpineArch="$(arch)" \
&& case "${alpineArch##*-}" in \
x86_64) ARCH='x64';; \
i386) ARCH='x86';; \
*) ;; \
esac \
&& addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
curl \
gnupg \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
Expand All @@ -34,6 +33,23 @@ RUN addgroup -g 1000 node \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& ( \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
&& curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
) || ( \
# backup build
apk add --no-cache --virtual .build-deps-full \
binutils-gold \
g++ \
gcc \
libgcc \
linux-headers \
make \
python \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
Expand All @@ -43,10 +59,12 @@ RUN addgroup -g 1000 node \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& apk del .build-deps-full \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
) \
&& apk del .build-deps

ENV YARN_VERSION 1.15.2

Expand Down
Loading

0 comments on commit 49723d6

Please sign in to comment.