This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
extract.dockerfile
39 lines (32 loc) · 1.99 KB
/
extract.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM alpine:3.9
ENV VERSION=v12.22.3 NPM_VERSION=6 YARN_VERSION=v1.22.10
# FROM alpine:3.11
# ENV VERSION=v14.17.3 NPM_VERSION=6 YARN_VERSION=v1.22.10
# FROM alpine:3.13
# ENV VERSION=v16.4.2 NPM_VERSION=7 YARN_VERSION=v1.22.10
RUN apk upgrade --no-cache -U && \
apk add --no-cache curl gnupg libstdc++
RUN curl -sfSLO https://unofficial-builds.nodejs.org/download/release/${VERSION}/node-${VERSION}-linux-x64-musl.tar.xz && \
curl -sfSLO https://unofficial-builds.nodejs.org/download/release/${VERSION}/SHASUMS256.txt && \
grep " node-${VERSION}-linux-x64-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c | grep ': OK$' && \
tar -xf node-${VERSION}-linux-x64-musl.tar.xz -C /usr --strip 1 && \
rm node-${VERSION}-linux-x64-musl.tar.xz
RUN npm install -g npm@${NPM_VERSION} && \
find /usr/lib/node_modules/npm -type d \( -name test -o -name .bin \) | xargs rm -rf
RUN for server in hkps://keys.openpgp.org ipv4.pool.sks-keyservers.net keyserver.pgp.com ha.pool.sks-keyservers.net; do \
gpg --keyserver $server --recv-keys \
6A010C5166006599AA17F08146C2130DFD2497F5 && break; \
done && \
curl -sfSL -O https://github.com/yarnpkg/yarn/releases/download/${YARN_VERSION}/yarn-${YARN_VERSION}.tar.gz -O https://github.com/yarnpkg/yarn/releases/download/${YARN_VERSION}/yarn-${YARN_VERSION}.tar.gz.asc && \
gpg --batch --verify yarn-${YARN_VERSION}.tar.gz.asc yarn-${YARN_VERSION}.tar.gz && \
mkdir /usr/local/share/yarn && \
tar -xf yarn-${YARN_VERSION}.tar.gz -C /usr/local/share/yarn --strip 1 && \
ln -s /usr/local/share/yarn/bin/yarn /usr/local/bin/ && \
ln -s /usr/local/share/yarn/bin/yarnpkg /usr/local/bin/ && \
rm yarn-${YARN_VERSION}.tar.gz*
RUN apk del curl gnupg && \
rm -rf /SHASUMS256.txt /tmp/* \
/usr/share/man/* /usr/share/doc /root/.npm /root/.node-gyp /root/.config \
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/docs \
/usr/lib/node_modules/npm/html /usr/lib/node_modules/npm/scripts && \
{ rm -rf /root/.gnupg || true; }