From 99ad60cc7b7a27dbd12a0469e1004e434909f2c3 Mon Sep 17 00:00:00 2001 From: winloong <21272660+vinloong@users.noreply.github.com> Date: Wed, 25 May 2022 15:35:47 +0800 Subject: [PATCH] add node16 --- 16/Dockerfile | 19 +++++++++++++++++++ 16/docker-entrypoint.sh | 11 +++++++++++ 2 files changed, 30 insertions(+) create mode 100644 16/Dockerfile create mode 100644 16/docker-entrypoint.sh diff --git a/16/Dockerfile b/16/Dockerfile new file mode 100644 index 0000000..2a5c7a9 --- /dev/null +++ b/16/Dockerfile @@ -0,0 +1,19 @@ +FROM repository.anxinyun.cn/devops/alpine:3-tz-hw + +ENV NODE_VERSION 16.14.2 + +RUN addgroup -g 1000 node \ + && adduser -u 1000 -G node -s /bin/sh -D node \ + && apk add --no-cache nodejs==16.14.2-r0 npm yarn \ + && node --version \ + && npm --version \ + && yarn --version \ + && npm config set registry https://registry.npm.taobao.org + +COPY docker-entrypoint.sh /usr/local/bin/ + +USER node + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] diff --git a/16/docker-entrypoint.sh b/16/docker-entrypoint.sh new file mode 100644 index 0000000..1b3116e --- /dev/null +++ b/16/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@"