generated from container/tmpl
winloong
2 years ago
2 changed files with 30 additions and 0 deletions
@ -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" ] |
@ -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…
Reference in new issue