Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # FROM node:lts-alpine
  2. # RUN apk update && apk --no-cache add shadow && \
  3. # usermod -u 1001 node && \
  4. # groupmod -g 1001 node
  5. # ARG UID=1000
  6. # ARG UNAME=gdp
  7. # ARG GID=1000
  8. # ARG GNAME=users
  9. # #RUN find / -group ${UID} -exec chgrp -h node {} \;
  10. # #RUN find / -user ${UID} -exec chown -h node {} \;
  11. # # RUN addgroup -g ${GID} ${GNAME}
  12. # RUN if [ $(getent group ${GNAME}) ]; then echo "group ${GNAME} already exists"; else addgroup -g ${GID} ${GNAME}; fi
  13. # # else
  14. # # echo "group does not exist."
  15. # # fi
  16. # # adduser -h /home/gdp -D -u 1000 gdp && \
  17. # RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
  18. # # chown -R gdp:gdp /home/gdp
  19. # USER ${UNAME}
  20. # COPY ./bashrc /home/${UNAME}/.bashrc
  21. # COPY ./inputrc /home/${UNAME}/.inputrc
  22. # COPY ./client-entrypoint.sh /usr/local/bin
  23. # USER root
  24. # RUN chmod +x /usr/local/bin/client-entrypoint.sh
  25. # USER ${UNAME}
  26. # CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
  27. # /////////////////////////////////////////////////////////////////////////////////
  28. FROM node:lts-alpine
  29. RUN apk update && apk --no-cache add shadow && \
  30. usermod -u 1001 node && \
  31. groupmod -g 1001 node
  32. RUN find / -group 1000 -exec chgrp -h node {} \;
  33. RUN find / -user 1000 -exec chown -h node {} \;
  34. ARG USER_UID
  35. ARG USER_UNAME
  36. ARG USER_GID
  37. ARG USER_GNAME
  38. RUN if [ $(getent group ${USER_GNAME}) ]; then echo "group ${USER_GNAME} already exists"; else addgroup -g ${USER_GID} ${USER_GNAME}; fi
  39. # RUN addgroup -g 1000 ${USER_GNAME}
  40. # adduser -h /home/gdp -D -u 1000 gdp && \
  41. RUN adduser -u ${USER_UID} -G ${USER_GNAME} -s /bin/sh -D ${USER_UNAME}
  42. # chown -R gdp:gdp /home/gdp
  43. USER ${USER_UNAME}
  44. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  45. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  46. COPY ./client-entrypoint.sh /usr/local/bin
  47. USER root
  48. RUN chmod +x /usr/local/bin/client-entrypoint.sh
  49. USER ${USER_UNAME}
  50. CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]