switch to non-root user in container

This commit is contained in:
Matthew Tran
2023-09-10 11:21:51 +00:00
parent 4308cd7bda
commit 83a89e548b
10 changed files with 52 additions and 23 deletions
+8 -6
View File
@@ -1,19 +1,21 @@
FROM ubuntu:22.04
WORKDIR /root
RUN apt-get update && apt-get upgrade
RUN apt-get install -y wget unzip
RUN useradd -m matt
USER matt
WORKDIR /home/matt
# from https://terraria.fandom.com/wiki/Server (currently 1.4.4.9)
RUN wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
RUN unzip terraria-server-1449.zip && rm terraria-server-1449.zip
RUN mv 1449/ server/
COPY entry.sh ./
COPY --chown=matt:matt entry.sh ./
WORKDIR /root/server/Linux
WORKDIR /home/matt/server/Linux
RUN chmod +x TerrariaServer.bin.x86_64
COPY password.default ./password.txt
COPY config.txt password.tx[t] ./
COPY --chown=matt:matt password.default ./password.txt
COPY --chown=matt:matt config.txt password.tx[t] ./