images/minecraft/Dockerfile

32 lines
767 B
Text
Raw Permalink Normal View History

2024-06-07 01:30:12 +00:00
FROM alpine
2024-06-06 21:27:05 +00:00
# set environment
ENV LANG en_US.UTF-8
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
ENV PATH=/usr/lib/jvm/java-21-openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# install packages
RUN apk add --no-cache tini wget openjdk21-jre jq curl shadow fontconfig ttf-dejavu
# copy scripts
COPY ./mcjar /usr/local/bin/mcjar
COPY ./mclauncher /usr/local/bin/mclauncher
RUN chmod +x /usr/local/bin/mcjar
RUN chmod +x /usr/local/bin/mclauncher
# make user
RUN addgroup -S mc && adduser -S mc -G mc
RUN groupmod --gid 1000 mc
RUN usermod --uid 1000 mc
# make volumes
RUN mkdir /data && chown mc:mc /data
VOLUME /data
# final
USER mc
WORKDIR /data
ENV SERVER_DIR=/data
2024-06-07 01:30:12 +00:00
ENTRYPOINT ["/sbin/tini", "--"]
2024-06-06 21:27:05 +00:00
CMD ["/usr/local/bin/mclauncher", "-l"]