Switch to alpine linux

This commit is contained in:
JeremyStar™ 2024-05-30 19:45:38 +02:00
parent 7d7d5b777b
commit d125dd3bdc
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -1,12 +1,11 @@
# Builder container
#############################
## BUILDER ##
## Builds rcon-cli for us. ##
#############################
FROM ghcr.io/archlinux/archlinux:latest AS builder
FROM alpine AS builder
RUN sed "s/SigLevel\ \ \ \ \=\ Required\ DatabaseOptional/SigLevel\ \=\ Optional/g" -i /etc/pacman.conf
RUN nice -20 pacman -Syu --noconfirm go base-devel git
RUN nice -20 apk update
RUN nice -20 apk add go git
RUN mkdir /builder /builder/bin
RUN git clone --depth=1 https://github.com/gorcon/rcon-cli /builder/rcon-cli
WORKDIR /builder/rcon-cli
@ -17,7 +16,7 @@ RUN nice -20 go build -ldflags "-s -w -X main.ServiceVersion=mcsd-builder" -o /b
## This container will be used to ##
## run a Minecraft server. ##
####################################
FROM ghcr.io/archlinux/archlinux:latest AS main
FROM alpine AS main
LABEL org.opencontainers.image.title="MCServerDocker"
LABEL org.opencontainers.image.description="Runs a Minecraft Server inside a Docker container."
LABEL org.opencontainers.image.authors="JeremyStarTM <jeremystartm@staropensource.de>"
@ -26,8 +25,9 @@ LABEL org.opencontainers.image.documentation="https://git.staropensource.de/Jere
LABEL org.opencontainers.image.source="https://git.staropensource.de/JeremyStarTM/MCServerDocker"
LABEL org.opencontainers.image.licenses="GPL-3.0-only"
RUN sh -c 'sed "s/SigLevel\ \ \ \ \=\ Required\ DatabaseOptional/SigLevel\ \=\ Optional/g" -i /etc/pacman.conf'
RUN nice -20 pacman -Syu --noconfirm jre17-openjdk jre11-openjdk jre8-openjdk
RUN true
RUN nice -20 apk update
RUN nice -20 apk add openjdk21-jre openjdk17-jre openjdk11-jre
RUN mkdir /app
ADD entrypoint.sh /app/entrypoint.sh
COPY --from=builder /builder/bin/rcon /usr/bin/rcon