steamcmd-container/Dockerfile

52 lines
2.2 KiB
Text
Raw Normal View History

2023-12-17 00:03:52 +00:00
# first image, simply get/unpack the steamcmd tarball
FROM fedora:39 as builder
LABEL maintainer="me@jlay.io" \
org.opencontainers.image.authors="me@jlay.io"
WORKDIR /root
RUN curl -sq http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -xvz
2021-11-17 00:27:39 +00:00
2023-12-17 00:03:52 +00:00
# second/real image: copy the unpacked tarball into an updated/prepared Fedora environment
FROM fedora:39
2021-11-17 00:27:39 +00:00
LABEL maintainer="me@jlay.io" \
org.opencontainers.image.authors="me@jlay.io"
2023-12-17 00:03:52 +00:00
ENV PATH="/opt/steamcmd:${PATH}"
2021-11-17 00:27:39 +00:00
2023-12-17 00:03:52 +00:00
# Install, update & upgrade packages
RUN set -x ; \
mkdir -vp /opt/steamcmd/linux32 ; \
sed -i -e 's/^LANG=".*"$/LANG="en_US.UTF-8"/' /etc/locale.conf ; \
(echo -e 'max_parallel_downloads=20\nfastestmirror=False\ndeltarpm=False' | tee -a /etc/dnf/dnf.conf) ; \
dnf --setopt=logdir=/tmp/dnf-prep-logs --setopt=cachedir=/tmp/dnf-prep-cache -qy up ; \
dnf --setopt=logdir=/tmp/dnf-prep-logs --setopt=cachedir=/tmp/dnf-prep-cache -qy install \
util-linux \
2023-12-17 00:50:59 +00:00
wget \
less \
findutils \
2023-12-17 00:03:52 +00:00
ca-certificates \
libgcc.{x86_64,i686} \
libstdc++.{x86_64,i686} \
glibc.{x86_64,i686} \
SDL2.{x86_64,i686} \
glibc-langpack-en ; \
find /tmp/dnf-prep-logs /tmp/dnf-prep-cache -delete
2021-11-20 01:29:49 +00:00
2023-12-17 00:03:52 +00:00
# from the builder, copy the extracted steamcmd bits
# COPY doesn't take directories with it, only their contents. so dumb.
COPY --from=builder /root/steam*.sh /opt/steamcmd
COPY --from=builder /root/linux32/* /opt/steamcmd/linux32/
2021-11-17 00:27:39 +00:00
2023-12-17 00:03:52 +00:00
# Make the Steam libraries permanently part of the environment
# for those who this inspires, a note:
# I would only recommend this *in containers*.
# it's remarkably easy to break loosely-linked software like this.
RUN echo '/opt/steamcmd/linux32' | tee /etc/ld.so.conf.d/steam.conf ; ldconfig ; \
ln -sv /opt/steamcmd/linux32/steam{client,service}.so
# also, map steamclient.so -> steamservice.so. this silences some complaints
2021-11-17 00:27:39 +00:00
2023-12-17 00:03:52 +00:00
# test steamcmd; ensure function and updates
RUN steamcmd.sh +quit
2021-11-17 00:27:39 +00:00
2023-12-17 00:03:52 +00:00
# default cmd, steamcmd 'installed' to /opt. required extending $PATH in env above
ENTRYPOINT ["steamcmd.sh"]
CMD ["+help", ""+quit"]