non-root smb share

This commit is contained in:
Matthew Tran
2025-02-21 01:09:27 -08:00
parent 077178cbe0
commit d693e31c85
6 changed files with 60 additions and 16 deletions
+8 -4
View File
@@ -6,11 +6,15 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y samba
# create required files and user
RUN groupadd -g 2003 me && useradd -u 2003 -g 2003 -m me
USER me
WORKDIR /home/me
# TODO copy config files
RUN mkdir share samba samba/log samba/lock samba/state samba/cache samba/pid samba/private samba/ncalrpc
COPY --chown=me:me smb.conf ./
COPY --chown=me:me entry.sh ./
COPY --chown=me:me smb.conf entry.sh ./
# create additional users
USER root
COPY users.sh ./
RUN /bin/sh users.sh && rm users.sh
USER me