From 3642bbdd22b12bad499b98b72af9a1dfd4d7b6c6 Mon Sep 17 00:00:00 2001 From: Alex Belanger Date: Mon, 11 Mar 2024 19:32:36 -0400 Subject: [PATCH] Updated Dockerfile with notes. --- Dockerfile | 27 ++++++++++++++++++--------- Dockerfile.guest | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 Dockerfile.guest diff --git a/Dockerfile b/Dockerfile index 854e25e1..74e6ae7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,31 @@ FROM perl:5.34 # Install system dependencies. -RUN apt-get update && apt-get install -y cpanminus wamerican +RUN apt-get update && apt-get install -y libssl-dev libexpat1-dev zlib1g libdbd-sqlite3-perl cpanminus wamerican pip -# Install pbot and its own dependencies. -# FIXME: Replace nitrix with pragma-. -RUN cd /opt && git clone --recursive https://github.com/nitrix/pbot +# Prefer a non-root user. +RUN useradd -ms /bin/bash pbot + +# Install pbot and its own dependencies (replace nitrix with pragma- eventually). +RUN cd /opt && git clone --recursive --depth=1 https://github.com/nitrix/pbot + +# Perl dependencies. +RUN cpanm --local-lib=/home/pbot/perl5 local::lib && eval $(perl -I /home/pbot/perl5/lib/perl5/ -Mlocal::lib) RUN cd /opt/pbot && cpanm -n --installdeps . --with-all-features --without-feature=compiler_vm_win32 +# Translate shell. +RUN sed -i 's/^Components: main$/& contrib/' /etc/apt/sources.list.d/debian.sources +RUN apt-get update && apt-get install -y libfribidi0 libfribidi-bin gawk libsigsegv2 translate-shell + +# Wiktionary parser. +RUN pip install git+https://github.com/pragma-/WiktionaryParser --break-system-packages + # Mount point to persist the bot's data. RUN mkdir /mnt/persistent -# Prefer a non-root user to run the bot. -RUN useradd -ms /bin/bash pbot -USER pbot - # Just in case files are created in the working directory. WORKDIR /home/pbot -# Executable. +# Entry point, running the executable as pbot user. +USER pbot ENTRYPOINT /opt/pbot/bin/pbot \ No newline at end of file diff --git a/Dockerfile.guest b/Dockerfile.guest new file mode 100644 index 00000000..9b6fb655 --- /dev/null +++ b/Dockerfile.guest @@ -0,0 +1,14 @@ +FROM debian:bookworm + +# Install system dependencies. +RUN apt-get update && apt-get install -y clang gcc clang g++ tcl ghc + +# Prefer a non-root user to run the guest. +RUN useradd -ms /bin/bash dummy +USER dummy + +# Just in case files are created in the working directory. +WORKDIR /home/dummy + +# Executable. +ENTRYPOINT /usr/bin/bash \ No newline at end of file