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,17 +1,19 @@
FROM ubuntu:22.04
WORKDIR /root
RUN apt-get update && apt-get upgrade
RUN apt-get install -y wget openjdk-18-jre
RUN useradd -m matt
USER matt
WORKDIR /home/matt
RUN wget https://github.com/Tiiffi/mcrcon/releases/download/v0.7.2/mcrcon-0.7.2-linux-x86-64.tar.gz
RUN tar xvf mcrcon-0.7.2-linux-x86-64.tar.gz
# from https://www.minecraft.net/en-us/download/server (currently 1.20.1)
RUN wget https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar
COPY eula.txt ./
COPY entry.sh ./
COPY server.properties ./
COPY ops.json ./
COPY --chown=matt:matt eula.txt ./
COPY --chown=matt:matt entry.sh ./
COPY --chown=matt:matt server.properties ./
COPY --chown=matt:matt ops.json ./