Dockerfile 885 B

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