|
@@ -1,33 +1,68 @@
|
|
|
+# FROM node:lts-alpine
|
|
|
+
|
|
|
+# RUN apk update && apk --no-cache add shadow && \
|
|
|
+# usermod -u 1001 node && \
|
|
|
+# groupmod -g 1001 node
|
|
|
+
|
|
|
+# ARG UID=1000
|
|
|
+# ARG UNAME=gdp
|
|
|
+# ARG GID=1000
|
|
|
+# ARG GNAME=users
|
|
|
+
|
|
|
+# #RUN find / -group ${UID} -exec chgrp -h node {} \;
|
|
|
+# #RUN find / -user ${UID} -exec chown -h node {} \;
|
|
|
+
|
|
|
+# # RUN addgroup -g ${GID} ${GNAME}
|
|
|
+# RUN if [ $(getent group ${GNAME}) ]; then echo "group ${GNAME} already exists"; else addgroup -g ${GID} ${GNAME}; fi
|
|
|
+# # else
|
|
|
+# # echo "group does not exist."
|
|
|
+# # fi
|
|
|
+# # adduser -h /home/gdp -D -u 1000 gdp && \
|
|
|
+# RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
|
|
|
+# # chown -R gdp:gdp /home/gdp
|
|
|
+
|
|
|
+# USER ${UNAME}
|
|
|
+
|
|
|
+# COPY ./bashrc /home/${UNAME}/.bashrc
|
|
|
+# COPY ./inputrc /home/${UNAME}/.inputrc
|
|
|
+
|
|
|
+# COPY ./client-entrypoint.sh /usr/local/bin
|
|
|
+# USER root
|
|
|
+# RUN chmod +x /usr/local/bin/client-entrypoint.sh
|
|
|
+# USER ${UNAME}
|
|
|
+# CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
|
|
+
|
|
|
+
|
|
|
+# /////////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+
|
|
|
FROM node:lts-alpine
|
|
|
|
|
|
RUN apk update && apk --no-cache add shadow && \
|
|
|
usermod -u 1001 node && \
|
|
|
groupmod -g 1001 node
|
|
|
|
|
|
-ARG UID=1000
|
|
|
-ARG UNAME=gdp
|
|
|
-ARG GID=1000
|
|
|
-ARG GNAME=users
|
|
|
+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 find / -group ${UID} -exec chgrp -h node {} \;
|
|
|
-#RUN find / -user ${UID} -exec chown -h node {} \;
|
|
|
|
|
|
-# RUN addgroup -g ${GID} ${GNAME}
|
|
|
-RUN if [ $(getent group ${GNAME}) ]; then echo "group ${GNAME} already exists"; else addgroup -g ${GID} ${GNAME}; fi
|
|
|
-# else
|
|
|
-# echo "group does not exist."
|
|
|
-# fi
|
|
|
+# RUN addgroup -g 1000 gdp && \
|
|
|
# adduser -h /home/gdp -D -u 1000 gdp && \
|
|
|
-RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
|
|
|
+RUN adduser -u ${USER_UID} -G users -s /bin/sh -D ${USER_UNAME}
|
|
|
# chown -R gdp:gdp /home/gdp
|
|
|
|
|
|
-USER ${UNAME}
|
|
|
+USER ${USER_UNAME}
|
|
|
|
|
|
-COPY ./bashrc /home/${UNAME}/.bashrc
|
|
|
-COPY ./inputrc /home/${UNAME}/.inputrc
|
|
|
+COPY ./bashrc /home/${USER_UNAME}/.bashrc
|
|
|
+COPY ./inputrc /home/${USER_UNAME}/.inputrc
|
|
|
|
|
|
COPY ./client-entrypoint.sh /usr/local/bin
|
|
|
USER root
|
|
|
RUN chmod +x /usr/local/bin/client-entrypoint.sh
|
|
|
-USER ${UNAME}
|
|
|
+USER ${USER_UNAME}
|
|
|
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|