- Migrate Paper loader from sunset v2 API to v3 (fill.papermc.io) - Fix NeoForge: fall back to beta versions when no stable exists (set -e + grep) - Fix setEula/setperms ordering (was writing eula.txt before /data was writable) - Fix setEula/serverInfoWrite to use absolute paths (/data/server/) - Add VOLUME directive removal (was shadowing bind mounts) - Add comprehensive API test suite (110 tests across 6 suites) - Move test.sh to tests/integration.sh, switch to named volumes - Add Docker build cache to CI workflows - Add .editorconfig, expand .gitignore, improve README docs
48 lines
1.3 KiB
Docker
48 lines
1.3 KiB
Docker
FROM debian:bookworm-slim
|
|
|
|
ARG UID=1000
|
|
ARG GID=1000
|
|
|
|
LABEL org.opencontainers.image.title="Dockercraft" \
|
|
org.opencontainers.image.description="Docker image for running Minecraft servers with support for multiple loaders" \
|
|
org.opencontainers.image.source="https://github.com/jeremymcclure/dockercraft"
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
curl \
|
|
ca-certificates \
|
|
jq \
|
|
libxml2-utils \
|
|
sudo \
|
|
tini \
|
|
unzip \
|
|
netcat-openbsd && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN groupadd -g ${GID} minecraft && \
|
|
useradd --create-home -u ${UID} -g ${GID} minecraft && \
|
|
echo 'minecraft ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
|
|
mkdir -p /data && \
|
|
chown -R ${UID}:${GID} /data
|
|
|
|
# Install Jabba (Java version manager) as minecraft user
|
|
RUN su -c "curl -sL https://github.com/Jabba-Team/jabba/raw/main/install.sh | bash && . ~/.jabba/jabba.sh" minecraft
|
|
|
|
COPY ./scripts/ /scripts/
|
|
RUN chmod +x /scripts/init
|
|
|
|
EXPOSE 25565/tcp 19132/udp 19133/udp
|
|
STOPSIGNAL SIGTERM
|
|
|
|
USER minecraft
|
|
|
|
HEALTHCHECK --start-period=2m --interval=30s --timeout=10s --retries=3 \
|
|
CMD bash -c 'if [ "${MC_LOADER}" = "bedrock" ]; then nc -zu 127.0.0.1 19132; else nc -z 127.0.0.1 25565; fi'
|
|
|
|
ENTRYPOINT ["tini", "--", "/scripts/init"]
|