-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.spigot
49 lines (30 loc) · 1.03 KB
/
Dockerfile.spigot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ARG MINECRAFT_VERSION=1.21.4
# Step 1 - Download required resources
FROM ruby:3.0.0-alpine AS downloads
ARG MINECRAFT_VERSION
WORKDIR /ruby
COPY ruby .
RUN bundle install
RUN chmod +x bin/spigot-cli && \
mkdir /downloads && \
mkdir /downloads/plugins
RUN bin/spigot-cli download_build_tools --version $MINECRAFT_VERSION --destination /downloads && \
bin/spigot-cli download_plugins --destination /downloads/plugins
# Step 2 - Build Spigot
FROM eclipse-temurin:22-jdk-alpine AS build
ARG MINECRAFT_VERSION
RUN apk add --no-cache git
WORKDIR /build
COPY --from=downloads /downloads/BuildTools.jar .
RUN git config --global --unset core.autocrlf & \
java -jar BuildTools.jar --rev $MINECRAFT_VERSION
# Step 3 - Run server
FROM eclipse-temurin:22-jre-alpine
ARG MINECRAFT_VERSION
WORKDIR /minecraft
COPY /minecraft .
COPY --from=build /build/spigot-$MINECRAFT_VERSION.jar ./server.jar
COPY --from=downloads /downloads/plugins ./plugins
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/minecraft/entrypoint.sh"]