generated from container/tmpl
loong
2 years ago
2 changed files with 8 additions and 23 deletions
@ -1,28 +1,13 @@ |
|||
FROM repository.anxinyun.cn/devops/alpine:3-tz-hw |
|||
FROM node:16-alpine3.15 |
|||
|
|||
ENV NODE_VERSION=16.15.1 |
|||
|
|||
ARG ARCH="x64" |
|||
|
|||
ARG NODE_BINARY="node-v$NODE_VERSION-linux-$ARCH-musl" |
|||
|
|||
COPY "${NODE_BINARY}.tar.xz" /tmp |
|||
|
|||
RUN addgroup -g 1000 node; \ |
|||
adduser -u 1000 -G node -s /bin/sh -D node; \ |
|||
set -eu; \ |
|||
apk add --no-cache libstdc++ ; \ |
|||
# 网络问题不能直接下载,手动下载 |
|||
# wget "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/${NODE_BINARY}.tar.xz" -P /tmp ; \ |
|||
tar -xJf "/tmp/${NODE_BINARY}.tar.xz" -C /usr/local --strip-components=1 --no-same-owner ; \ |
|||
ln -s /usr/local/bin/node /usr/local/bin/nodejs; \ |
|||
rm -f "/tmp/${NODE_BINARY}.tar.xz"; \ |
|||
node --version; \ |
|||
npm --version; \ |
|||
RUN set -eu; \ |
|||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories; \ |
|||
apk add --no-cache tzdata \ |
|||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
|||
&& echo "Asia/Shanghai" > /etc/timezone \ |
|||
&& apk del tzdata; \ |
|||
npm config set registry https://registry.npm.taobao.org; \ |
|||
cp /root/.npmrc /home/node/ ; \ |
|||
cp /root/.npmrc /home/node; \ |
|||
chown node:node /home/node/.npmrc |
|||
|
|||
USER node |
|||
|
|||
CMD [ "node" ] |
Binary file not shown.
Loading…
Reference in new issue