-
Notifications
You must be signed in to change notification settings - Fork 12
/
prepare_alpine_node_docker.sh
23 lines (18 loc) · 1.86 KB
/
prepare_alpine_node_docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
echo "LATEST/V10LTS/V8LTS (copy and run)":
cat <<EE
NODE_VERSION_NUM=\`wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p'\` && echo \$NODE_VERSION_NUM && \\
wget -c https://nodejs.org/dist/\$NODE_VERSION_NUM/node-\$NODE_VERSION_NUM-linux-x64.tar.gz && \\
tar xzvf node-\$NODE_VERSION_NUM-linux-x64.tar.gz -C alpine_node_latest/ && \\
cd alpine_node_latest/ && rm -f node npm && ln -s node-\$NODE_VERSION_NUM-linux-x64/bin/node node && ln -s node-\$NODE_VERSION_NUM-linux-x64/bin/npm npm && cd .. && ls -al alpine_node_latest/
# docker run -ti -v \$PWD:/work/ -w /work/ cmptech/auto_alpine_nodejs_baseline /work/alpine_node_latest/node-\$NODE_VERSION_NUM-linux-x64/bin/node -p process.versions
docker run -ti -v \$PWD:/work/ -w /work/ cmptech/auto_alpine_glibc /work/alpine_node_latest/node-\$NODE_VERSION_NUM-linux-x64/bin/node -p process.versions
NODE_VERSION_NUM=\`wget -qO- https://nodejs.org/dist/latest-v8.x/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p'\` && wget -c https://nodejs.org/dist/\$NODE_VERSION_NUM/node-\$NODE_VERSION_NUM.tar.gz && \\
wget -c https://nodejs.org/dist/\$NODE_VERSION_NUM/node-\$NODE_VERSION_NUM-linux-x64.tar.gz && \\
tar xzvf node-\$NODE_VERSION_NUM-linux-x64.tar.gz -C alpine_node_latest/
NODE_VERSION_NUM=\`wget -qO- https://nodejs.org/dist/latest-v10.x/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p'\` && wget -c https://nodejs.org/dist/\$NODE_VERSION_NUM/node-\$NODE_VERSION_NUM.tar.gz && \\
wget -c https://nodejs.org/dist/\$NODE_VERSION_NUM/node-\$NODE_VERSION_NUM-linux-x64.tar.gz && \\
tar xzvf node-\$NODE_VERSION_NUM-linux-x64.tar.gz -C alpine_node_latest/
EE
echo test latest:
# docker run -ti -v $PWD:/work/ -w /work/ cmptech/auto_alpine_nodejs_baseline sh -c "/work/alpine_node_latest/node -p 'process.versions'"
docker run -ti -v $PWD:/work/ -w /work/ cmptech/auto_alpine_glibc /work/alpine_node_latest/node -p process.versions