From 91b0615809e406214c58c6a091002fccadd915da Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 20 Apr 2024 17:02:31 +0200 Subject: [PATCH] Improve image building performance --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 687f90d..2eb0772 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ ############################# FROM ghcr.io/archlinux/archlinux:latest AS builder -RUN pacman -Syu --noconfirm go base-devel git +RUN nice -20 pacman -Syu --noconfirm go base-devel git mold RUN mkdir /builder /builder/bin -RUN git clone https://github.com/gorcon/rcon-cli /builder/rcon-cli +RUN git clone --depth=1 https://github.com/gorcon/rcon-cli /builder/rcon-cli WORKDIR /builder/rcon-cli -RUN go build -ldflags "-s -w -X main.ServiceVersion=mcsd-builder" -o /builder/bin/rcon ./cmd/gorcon/main.go +RUN nice -20 go build -ldflags "-s -w -fuse-ld=mold -X main.ServiceVersion=mcsd-builder" -o /builder/bin/rcon ./cmd/gorcon/main.go #################################### ## MAIN ## @@ -25,7 +25,7 @@ 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 pacman -Syu --noconfirm jre17-openjdk jre11-openjdk jre8-openjdk +RUN nice -20 pacman -Syu --noconfirm jre17-openjdk jre11-openjdk jre8-openjdk RUN mkdir /app ADD entrypoint.sh /app/entrypoint.sh COPY --from=builder /builder/bin/rcon /usr/bin/rcon