MCServerDocker/Dockerfile

40 lines
1.6 KiB
Text
Raw Normal View History

2024-01-27 16:58:04 +01:00
#############################
## BUILDER ##
## Builds rcon-cli for us. ##
#############################
2024-05-30 19:45:38 +02:00
FROM alpine AS builder
2024-01-27 16:58:04 +01:00
2024-05-30 19:45:38 +02:00
RUN nice -20 apk update
2024-05-30 19:48:37 +02:00
RUN nice -20 apk upgrade
2024-05-30 19:45:38 +02:00
RUN nice -20 apk add go git
2024-01-27 16:58:04 +01:00
RUN mkdir /builder /builder/bin
2024-04-20 17:02:31 +02:00
RUN git clone --depth=1 https://github.com/gorcon/rcon-cli /builder/rcon-cli
2024-01-27 16:58:04 +01:00
WORKDIR /builder/rcon-cli
2024-04-20 17:03:47 +02:00
RUN nice -20 go build -ldflags "-s -w -X main.ServiceVersion=mcsd-builder" -o /builder/bin/rcon ./cmd/gorcon/main.go
2024-01-27 16:58:04 +01:00
####################################
## MAIN ##
## This container will be used to ##
## run a Minecraft server. ##
####################################
2024-05-30 19:45:38 +02:00
FROM alpine AS main
2024-01-27 17:13:25 +01:00
LABEL org.opencontainers.image.title="MCServerDocker"
LABEL org.opencontainers.image.description="Runs a Minecraft Server inside a Docker container."
2024-01-25 23:12:09 +01:00
LABEL org.opencontainers.image.authors="JeremyStarTM <jeremystartm@staropensource.de>"
2024-01-27 17:13:25 +01:00
LABEL org.opencontainers.image.url="https://git.staropensource.de/JeremyStarTM/MCServerDocker"
LABEL org.opencontainers.image.documentation="https://git.staropensource.de/JeremyStarTM/MCServerDocker/src/branch/develop/README.md"
LABEL org.opencontainers.image.source="https://git.staropensource.de/JeremyStarTM/MCServerDocker"
LABEL org.opencontainers.image.licenses="GPL-3.0-only"
2024-01-25 23:12:09 +01:00
2024-05-30 19:45:38 +02:00
RUN true
RUN nice -20 apk update
2024-05-30 19:48:37 +02:00
RUN nice -20 apk upgrade
2024-07-10 12:35:48 +02:00
RUN nice -20 apk add bash libstdc++ openjdk21-jre openjdk17-jre openjdk11-jre openjdk8-jre
2024-01-25 23:12:09 +01:00
RUN mkdir /app
ADD entrypoint.sh /app/entrypoint.sh
2024-01-27 16:58:04 +01:00
COPY --from=builder /builder/bin/rcon /usr/bin/rcon
2024-01-25 23:12:09 +01:00
STOPSIGNAL SIGTERM
EXPOSE 25565 25565/tcp
2024-05-30 19:54:30 +02:00
ENTRYPOINT ["bash", "/app/entrypoint.sh"]