Proper users.

This commit is contained in:
Alex Belanger 2024-03-11 23:39:22 -04:00
parent f1d9570917
commit 568ebb6c56
No known key found for this signature in database
GPG Key ID: 31736D2B10A5F158
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ RUN apt-get install -y libfribidi0 libfribidi-bin gawk libsigsegv2 translate-she
RUN useradd -ms /bin/bash pbot
# Location for perl libraries.
RUN su -u pbot cpanm --local-lib=/home/pbot/perl5 local::lib && eval $(perl -I /home/pbot/perl5/lib/perl5/ -Mlocal::lib)
RUN su pbot && cpanm --local-lib=/home/pbot/perl5 local::lib && eval $(perl -I /home/pbot/perl5/lib/perl5/ -Mlocal::lib)
# Install pbot from sources and get dependencies.
COPY . /opt/pbot

View File

@ -13,15 +13,15 @@ RUN sed -i -e "s/\/dev\/ttyS2/\/tmp\/ttyS2/g" /opt/pbot/applets/pbot-vm/guest/bi
RUN sed -i -e "s/\/dev\/ttyS3/\/tmp\/ttyS3/g" /opt/pbot/applets/pbot-vm/guest/bin/guest-server
# Setup the guest server.
RUN cd /opt/pbot/applets/pbot-vm/guest/bin && ln -al
RUN cd /opt/pbot/applets/pbot-vm/guest/bin && ls -al
RUN cd /opt/pbot/applets/pbot-vm && ./guest/bin/setup-guest
# Prefer a non-root user.
RUN useradd -ms /bin/bash vm
USER vm
# Just in case files are created in the working directory.
WORKDIR /home/vm
# Single entry point for both the host and the guest.
USER vm
ENTRYPOINT ["/opt/pbot/applets/pbot-vm/entrypoint.sh"]