FROM node:lts-alpine # RUN apk update && apk --no-cache add shadow && \ # usermod -u 1001 node && \ # groupmod -g 1001 node # RUN find / -group 1000 -exec chgrp -h node {} \; # RUN find / -user 1000 -exec chown -h node {} \; ARG USER_UID ARG USER_UNAME ARG USER_GID ARG USER_GNAME RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\ groupadd -g ${USER_GID} ${USER_GNAME} &&\ useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\ install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\ chown --changes --silent --no-dereference --recursive \ --from=33:33 ${USER_UID}:${USER_GID} \ /home/${USER_UNAME} COPY ./bashrc /home/${USER_UNAME}/.bashrc COPY ./inputrc /home/${USER_UNAME}/.inputrc USER root COPY ./client-entrypoint.sh /usr/local/bin RUN chmod +x /usr/local/bin/client-entrypoint.sh USER ${USER_UNAME} CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]