Browse Source

add node16

main
winloong 2 years ago
parent
commit
99ad60cc7b
  1. 19
      16/Dockerfile
  2. 11
      16/docker-entrypoint.sh

19
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" ]

11
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 "$@"
Loading…
Cancel
Save