Compare commits
5 Commits
bdbcebf366
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| bed8684352 | |||
| 58e34860fd | |||
| 8d2c901978 | |||
| 07c8bfd165 | |||
| 30802403cc |
11
Dockerfile
11
Dockerfile
@@ -4,8 +4,9 @@ ARG FORGE_VERSION="36.2.26"
|
|||||||
ARG JRE_VERSION="openjdk8-jre"
|
ARG JRE_VERSION="openjdk8-jre"
|
||||||
|
|
||||||
ARG UID=1520
|
ARG UID=1520
|
||||||
ARG GID=1520
|
|
||||||
ARG USER=minecraft
|
ARG USER=minecraft
|
||||||
|
ARG GID=1520
|
||||||
|
ARG GROUP=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
|
||||||
@@ -30,12 +31,18 @@ FROM alpine:latest AS final
|
|||||||
|
|
||||||
# Use only a subset of arguments
|
# Use only a subset of arguments
|
||||||
ARG JRE_VERSION
|
ARG JRE_VERSION
|
||||||
|
ARG UID
|
||||||
|
ARG USER
|
||||||
|
ARG GID
|
||||||
|
ARG GROUP
|
||||||
|
|
||||||
# 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 .
|
||||||
|
RUN addgroup -g "${GID}" "${GROUP}" && \
|
||||||
|
adduser -h /minecraft -s /bin/sh -D -H -u "${UID}" -G "${GROUP}" "${USER}" && \
|
||||||
|
chown "${USER}:${GROUP}" /minecraft
|
||||||
USER $USER
|
USER $USER
|
||||||
CMD [ "bash", "start-server.sh" ]
|
CMD [ "bash", "start-server.sh" ]
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
|||||||
Reference in New Issue
Block a user