run as normal user, not root
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jeffrey Paul 2020-03-22 06:02:15 -07:00
parent d5e258ff01
commit 67833a1b2d
2 changed files with 9 additions and 1 deletions

View File

@ -7,6 +7,10 @@ ENV DEFAULT_ADMIN_PASSWORD hunter2
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
ARG UID_TO_ADD=10000
ARG GID_TO_ADD=10000
ARG USERNAME_TO_ADD=user
RUN echo "deb $UBUNTU_MIRROR bionic main universe restricted multiverse" > /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR bionic-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR bionic-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
@ -40,6 +44,9 @@ RUN \
rsync -avP /tmp/rootoverlay/ / && \
rm -rf /tmp/rootoverlay && \
rm -r /root/go && \
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
useradd -u $UID_TO_ADD -g $GID_TO_ADD -s /bin/bash $USERNAME_TO_ADD && \
usermod -p '*' $USERNAME_TO_ADD && \
chmod a+rx /etc/service/*/run
CMD ["/usr/local/sbin/runsvinit"]

View File

@ -19,5 +19,6 @@ if [[ ! -e /config/users.txt ]]; then
echo "[{\"password\":\"$DEFAULT_ADMIN_PASSWORD\",\"nick\":\"admin\",\"level\":10,\"regby\":\"admin\",\"regtime\":1322835912}]" > /config/users.txt
fi
chown -R user:user /config
cd /config
exec /usr/local/bin/adchppd -c /config
exec chpst -u user:user /usr/local/bin/adchppd -c /config