Try adding a user to the container
This commit is contained in:
parent
e057c808a8
commit
e48fa26b5a
@ -3,6 +3,10 @@ ARG MINECRAFT_VERSION="1.16.5"
|
|||||||
ARG FORGE_VERSION="36.2.26"
|
ARG FORGE_VERSION="36.2.26"
|
||||||
ARG JRE_VERSION="openjdk8-jre"
|
ARG JRE_VERSION="openjdk8-jre"
|
||||||
|
|
||||||
|
ARG UID=1520
|
||||||
|
ARG GID=1520
|
||||||
|
ARG USER=minecraft
|
||||||
|
|
||||||
# The first stage just builds up the modpack
|
# The first stage just builds up the modpack
|
||||||
FROM alpine:latest AS build
|
FROM alpine:latest AS build
|
||||||
|
|
||||||
@ -29,7 +33,9 @@ ARG JRE_VERSION
|
|||||||
|
|
||||||
# Build the thing up
|
# Build the thing up
|
||||||
RUN apk add bash curl findutils rsync screen "${JRE_VERSION}"
|
RUN apk add bash curl findutils rsync screen "${JRE_VERSION}"
|
||||||
|
RUN groupadd -g $GID -o $USER && useradd -m -u $UID -g $GID -o -s /bin/bash $USER
|
||||||
WORKDIR /minecraft
|
WORKDIR /minecraft
|
||||||
COPY --from=build /minecraft .
|
COPY --from=build /minecraft .
|
||||||
|
USER $USER
|
||||||
CMD [ "bash", "start-server.sh" ]
|
CMD [ "bash", "start-server.sh" ]
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
Loading…
Reference in New Issue
Block a user