Use Alpine instead of the OpenJDK upstream image

Thinner and actually respects that JRE_VERSION var we added
This commit is contained in:
Salt 2022-05-17 11:07:10 -05:00
parent 4236f531da
commit 322b6f359d
1 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ARG MINECRAFT_VERSION="1.16.5"
ARG FORGE_VERSION="36.2.26"
ARG JRE_VERSION="openjdk8-jre"
# The actual setup work
# Build us up the basics of the Minecraft server environment
COPY start-server.sh /minecraft/start-server.sh
WORKDIR /minecraft
RUN apk add curl "${JRE_VERSION}" &&\
@ -16,9 +16,9 @@ RUN apk add curl "${JRE_VERSION}" &&\
rm installer.jar installer.jar.log && \
ln -s "forge-${MINECRAFT_VERSION}-${FORGE_VERSION}.jar" server.jar
# The second stage is the actual container
FROM openjdk:11
RUN apt-get update && apt-get install rsync screen -y
# Stuff them in a smaller container with fewer layers
FROM alpine:latest
RUN apk add bash rsync screen "${JRE_VERSION}"
WORKDIR /minecraft
COPY --from=build /minecraft .
CMD [ "bash", "start-server.sh" ]