Skip to content

Commit 2bdae09

Browse files
committed
Debloat dockerfile
1 parent d3de8e3 commit 2bdae09

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
FROM eclipse-temurin:17-jre-jammy
1+
FROM eclipse-temurin:17-jre-jammy AS builder
22
RUN apt-get -qq update && apt-get -qq install -y unzip jq
33

44
RUN curl -fsSL -o "/tmp/rcon.tar.gz" $(curl -s https://api.github.com/repos/gorcon/rcon-cli/releases/latest | jq -r '.assets | map(select(.name | test("amd64_linux")))[0].browser_download_url')
55
RUN mkdir /tmp/rcon
66
RUN tar -xf /tmp/rcon.tar.gz -C /tmp/rcon --strip-components=1
7-
RUN install -m 755 /tmp/rcon/rcon /usr/local/bin/rcon-cli
8-
RUN install -m 644 /tmp/rcon/rcon.yaml /etc/rcon.yaml
9-
COPY --chmod=755 rcon /usr/local/bin/rcon
10-
RUN rm -r /tmp/rcon.tar.gz /tmp/rcon
117

12-
RUN mkdir /data
138
WORKDIR /data
149
RUN curl -fsSL -o "/tmp/pack.zip" "https://www.curseforge.com/api/v1/mods/681792/files/5795941/download"
1510
RUN curl -fsSL -o "/tmp/old.zip" "https://www.curseforge.com/api/v1/mods/681792/files/4496671/download"
16-
RUN unzip -q /tmp/pack.zip
11+
RUN unzip -q /tmp/pack.zip -d /data
1712
RUN unzip -q /tmp/old.zip -d /tmp/old/
1813
RUN cp /tmp/old/mods/vinery-1.1.4.jar mods/
1914
RUN cp /tmp/old/mods/Hephaestus-1.18.2-3.5.2.155.jar mods/
20-
RUN rm /tmp/pack.zip
21-
RUN rm /tmp/old.zip
22-
RUN rm -rf /tmp/old/
2315
RUN curl -fsSL -o "server.jar" "https://meta.fabricmc.net/v2/versions/loader/1.18.2/0.16.3/0.11.1/server/jar"
2416

25-
26-
RUN mkdir init
17+
FROM eclipse-temurin:17-jre-jammy
18+
COPY --from=builder --chmod=755 /tmp/rcon/rcon /usr/local/bin/rcon-cli
19+
COPY --from=builder --chmod=644 /tmp/rcon/rcon.yaml /etc/rcon.yaml
20+
COPY --chmod=755 rcon /usr/local/bin/rcon
2721
COPY --chmod=755 entrypoint.sh /entrypoint.sh
2822

23+
COPY --from=builder /data /data
24+
WORKDIR /data
25+
2926
VOLUME [ "/data/world", "/data/backups" ]
3027
EXPOSE 25565/tcp
3128

0 commit comments

Comments
 (0)