# Stage 1: Build SteamCMD environment FROM opensuse/leap:15.6 AS builder # Install dependencies RUN --mount=type=cache,id=sle-pkgs,sharing=locked,target=/var/cache/zypp zypper --non-interactive update && \ zypper --non-interactive install \ bzip2 ca-certificates curl libarchive13 glibc-32bit libgcc_s1-32bit p7zip tar unzip gzip wget xz ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8 ENV HOME=/app RUN groupadd -g 1000 steamcmd && \ useradd -u 1000 -g 1000 -d /app -s /bin/bash steamcmd && \ mkdir -p /app /output && \ chown 1000:1000 -R /app && \ chown 1000:1000 -R /output USER steamcmd WORKDIR /app # Download SteamCMD; run it once for self-updates RUN wget -qO- http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar xz -C /app && \ chmod +x /app/steamcmd.sh && \ ./steamcmd.sh +force_install_dir /output +login anonymous +quit COPY --chown=1000:1000 setuser.sh /usr/local/bin/setuser.sh RUN chmod +x /usr/local/bin/setuser.sh # Stage 2: Final Image FROM opensuse/leap:15.6 # Copy SteamCMD files from builder stage COPY --from=builder /app /app COPY --from=builder /output /output COPY --from=builder /usr/local/bin/setuser.sh /usr/local/bin/setuser.sh RUN chmod +x /usr/local/bin/setuser.sh ENV HOME=/app USER steamcmd WORKDIR /app CMD ["/app/steamcmd.sh", "+quit"]