Pratyush Desai 5f7d650161
SteamCMD podman compatible openSUSE contianer
This is the initial work. Will add labels w/e

Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
2025-04-30 05:47:26 +05:30

45 lines
1.3 KiB
Docker

# 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"]