parent
25038162ed
commit
dfa277ca08
@ -1,103 +1,49 @@
|
||||
FROM debian:jessie
|
||||
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
|
||||
FROM ubuntu:bionic
|
||||
|
||||
# To avoid problems with Dialog and curses wizards
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# 1. Keep the image updated
|
||||
# 2. Install the dependencies
|
||||
# 3. Install the latest version of Steam
|
||||
# http://repo.steampowered.com/steam
|
||||
RUN echo "deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam" > /etc/apt/sources.list.d/tmp-steam.list
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0xF24AEA9FB05498B7
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN apt-get update
|
||||
RUN apt-get -y upgrade
|
||||
RUN apt-get -y dist-upgrade
|
||||
RUN apt-get -fy install
|
||||
RUN apt-get -y install binutils pciutils pulseaudio libcanberra-gtk-module \
|
||||
libopenal1 libnss3 libgconf-2-4 libxss1 libnm-glib4 \
|
||||
libnm-util2 libglu1-mesa locales libsdl2-image-2.0 \
|
||||
steam-launcher \
|
||||
mesa-utils:i386 \
|
||||
libstdc++5 libstdc++5:i386 libbz2-1.0:i386 \
|
||||
libavformat56 libswscale3 libavcodec56:i386 \
|
||||
libavformat56:i386 libavresample2:i386 libavutil54:i386 \
|
||||
libswscale3:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 \
|
||||
libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libc6:i386 \
|
||||
libxtst6:i386 libxrandr2:i386 libglib2.0-0:i386 \
|
||||
libgtk2.0-0:i386 libgdk-pixbuf2.0-0:i386 libsm6:i386 \
|
||||
libice6:i386 libopenal1:i386 libdbus-glib-1-2:i386 \
|
||||
libnm-glib4:i386 libnm-util2:i386 libusb-1.0-0:i386 \
|
||||
libnss3:i386 libgconf-2-4:i386 libxss1:i386 libcurl3:i386 \
|
||||
libv8-dev:i386 \
|
||||
libcanberra-gtk-module:i386 libpulse0:i386 attr \
|
||||
libva-x11-1:amd64 libva-x11-1:i386 && \
|
||||
rm -f /etc/apt/sources.list.d/tmp-steam.list && \
|
||||
rm -rf /var/lib/apt/lists
|
||||
|
||||
# Not sure whether we really need these:
|
||||
# libcurl3 libcanberra-gtk-module
|
||||
|
||||
# Workaround missing lib in .local/share/Steam/ubuntu12_32/steamclient.so
|
||||
RUN ln -sv libudev.so.1 /lib/i386-linux-gnu/libudev.so.0
|
||||
|
||||
# Add missing symlink to make some games work (e.g. "Alien: Isolation")
|
||||
RUN ln -sv librtmp.so.1 /usr/lib/x86_64-linux-gnu/librtmp.so.0 && \
|
||||
ln -sv librtmp.so.1 /usr/lib/i386-linux-gnu/librtmp.so.0
|
||||
|
||||
# Workaround: Ubuntu 16.04 doesn't have libgcrypt11 nor libjson-c3, so we take
|
||||
# them from trusty
|
||||
# libcryptot11 is required by Half-Life based games
|
||||
# TODO: use debian mirrors if possible?
|
||||
ADD http://archive.ubuntu.com/ubuntu/pool/main/libg/libgcrypt11/libgcrypt11_1.5.3-2ubuntu4_i386.deb /tmp/libgcrypt11_i386.deb
|
||||
ADD http://archive.ubuntu.com/ubuntu/pool/main/libg/libgcrypt11/libgcrypt11_1.5.3-2ubuntu4_amd64.deb /tmp/libgcrypt11_amd64.deb
|
||||
ADD http://ftp.de.debian.org/debian/pool/main/j/json-c/libjson-c3_0.12.1-1.1_amd64.deb /tmp/libjson-c3_amd64.deb
|
||||
RUN cd /tmp && \
|
||||
dpkg -i *.deb && \
|
||||
rm -f *.deb
|
||||
|
||||
# Workaround2: Steam severely floods DNS requests on Linux, so let's use a DNS cache
|
||||
# (see https://github.com/ValveSoftware/steam-for-linux/issues/3401)
|
||||
RUN apt-get update && \
|
||||
apt-get -y install dnsmasq
|
||||
apt-get -y install gnupg
|
||||
|
||||
# Install Steam
|
||||
RUN echo "deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam" | tee /etc/apt/sources.list.d/tmp-steam.list && \
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0xF24AEA9FB05498B7 && \
|
||||
apt-get update && \
|
||||
apt-get -y install steam-launcher && \
|
||||
rm -vf /etc/apt/sources.list.d/tmp-steam.list
|
||||
|
||||
# Install Steam dependencies
|
||||
RUN dpkg --add-architecture i386 && \
|
||||
apt-get update && \
|
||||
apt-get -y install libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libc6:i386
|
||||
|
||||
# Steam severely floods DNS requests on Linux, so let's use a DNS cache.
|
||||
# Run docker image with: ``--dns 127.0.0.1`` flag to use the dnsmasq for DNS cache.
|
||||
# https://github.com/ValveSoftware/steam-for-linux/issues/3401
|
||||
RUN apt-get -y install dnsmasq
|
||||
COPY ./dnsmasq.conf /etc/dnsmasq.conf
|
||||
COPY ./resolv.conf /etc/resolv.dnsmasq
|
||||
COPY ./resolv.dnsmasq /etc/resolv.dnsmasq
|
||||
|
||||
# Fix bug https://github.com/arno01/steam/issues/11 where Pulseaudio crashes
|
||||
# when microphone is accessed via push-to-talk.
|
||||
RUN echo "enable-shm = no" >> /etc/pulse/client.conf
|
||||
|
||||
# Get newer MESA to support new GPU (graphic cards)
|
||||
RUN echo "deb http://deb.debian.org/debian jessie-backports main" | tee -a /etc/apt/sources.list
|
||||
RUN apt-get update
|
||||
RUN apt-get -y -t jessie-backports install libegl1-mesa-drivers:amd64 libegl1-mesa-drivers:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1-mesa-glx:amd64 libgl1-mesa-glx:i386 libglapi-mesa:amd64 libglapi-mesa:i386 libegl1-mesa:amd64 libegl1-mesa:i386 libgbm1:amd64 libgbm1:i386 libopenvg1-mesa:amd64 libopenvg1-mesa:i386 libwayland-egl1-mesa:amd64 libwayland-egl1-mesa:i386
|
||||
# Proton/vulkan deps
|
||||
RUN apt-get -y install python3 libvulkan1
|
||||
RUN apt-get -y autoremove
|
||||
|
||||
# locale-gen: Generate locales based on /etc/locale.gen file
|
||||
# update-locale: Generate config /etc/default/locale (later read by /etc/pam.d/su, /etc/pam.d/login, /etc/pam.d/polkit-1)
|
||||
RUN sed -i.orig '/^# en_US.UTF-8.*/s/^#.//g' /etc/locale.gen && \
|
||||
# Set locale to: en_US.UTF-8
|
||||
RUN apt-get -y install locales && \
|
||||
sed -i.orig '/^# en_US.UTF-8.*/s/^#.//g' /etc/locale.gen && \
|
||||
locale-gen && \
|
||||
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
# Create a user
|
||||
ENV USER user
|
||||
ENV UID 1000
|
||||
ENV GROUPS audio,video
|
||||
ENV HOME /home/$USER
|
||||
RUN useradd -m -d $HOME -u $UID -G $GROUPS $USER
|
||||
|
||||
# DEBUGGING
|
||||
#RUN apt-get -y install alsa-utils mesa-utils vim less gdb strace binutils wget
|
||||
# Let ALSA lib talk to Pulseaudio.
|
||||
# AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
|
||||
# ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
|
||||
RUN apt-get -y install libasound2-plugins libasound2-plugins:i386
|
||||
|
||||
WORKDIR $HOME
|
||||
# Fix to: "steam launcher crashes on second run (debian sid in a chroot on debian wheezy) #3501"
|
||||
# https://github.com/ValveSoftware/steam-for-linux/issues/3501
|
||||
RUN apt-get -y install libnm-glib4:i386 libnm-util2:i386
|
||||
|
||||
ENV STEAM_RUNTIME 0
|
||||
# Fix to: "Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element"
|
||||
# https://github.com/ValveSoftware/steam-for-linux/issues/3307
|
||||
RUN apt-get -y install fontconfig:i386
|
||||
|
||||
LABEL maintainer="Andrey Arapov <andrey.arapov@nixaid.com>"
|
||||
COPY ./launch /launch
|
||||
ENTRYPOINT [ "/bin/bash", "/launch" ]
|
||||
|
@ -1,4 +1,4 @@
|
||||
Steam will store its data in this folder:
|
||||
|
||||
- .steam/ for updates, game downloads & storage.
|
||||
- .local/share/Steam/ for account configuration.
|
||||
- .steam/ for updates, game downloads & storage;
|
||||
- .local/share/Steam/ for account configuration;
|
||||
|
@ -1,66 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Make errors visible upon `docker logs -f steam` command
|
||||
#
|
||||
exec 2>&1
|
||||
|
||||
service dnsmasq start
|
||||
|
||||
#
|
||||
# Befriend with grsecurity patched Linux kernel
|
||||
#
|
||||
# TODO: find a way how to set these attributes dynamically,
|
||||
# since this currently requires a Steam restart
|
||||
# when new content is obtained.
|
||||
if [ -f /proc/sys/kernel/grsecurity/tpe_gid ]; then
|
||||
groupadd -r -g $(cat /proc/sys/kernel/grsecurity/tpe_gid) grsec-tpe
|
||||
usermod -aG grsec-tpe $USER
|
||||
setfattr -n user.pax.flags -v "m" \
|
||||
/lib/i386-linux-gnu/ld-2.19.so \
|
||||
$HOME/.local/share/Steam/ubuntu12_32/steam \
|
||||
$HOME/.local/share/Steam/ubuntu12_32/steamwebhelper \
|
||||
$HOME/.local/share/Steam/ubuntu12_32/gameoverlayui \
|
||||
$HOME/.local/share/Steam/steamapps/common/Half-Life/hl_linux \
|
||||
$HOME/.local/share/Steam/steamapps/common/Counter-Strike\ Global\ Offensive\csgo_linux64
|
||||
# paxctl -c -v -m /lib/i386-linux-gnu/ld-2.19.so
|
||||
fi
|
||||
id user >/dev/null 2>&1
|
||||
[ $? -eq 0 ] || useradd -s /bin/bash -d /home/user -u ${USER_ID:-1000} user
|
||||
|
||||
#
|
||||
# Add a user to a detected "video" group
|
||||
# so that it can access the nvidia devices
|
||||
#
|
||||
if [ -e /dev/nvidiactl ]; then
|
||||
GID=$(stat -c '%g' /dev/nvidiactl)
|
||||
groupadd -r -g $GID nvidia1
|
||||
if [ $? -eq 0 ]; then
|
||||
usermod -aG nvidia1 $USER
|
||||
else
|
||||
GROUP=$(stat -c '%G' /dev/nvidiactl)
|
||||
usermod -aG $GROUP $USER
|
||||
fi
|
||||
fi
|
||||
# NOTE: This workaround has been obsolete by "apt-get -y install libnm-glib4:i386 libnm-util2:i386".
|
||||
# WORKAROUND to "steam launcher crashes on second run (debian sid in a chroot on debian wheezy) #3501"
|
||||
# https://github.com/ValveSoftware/steam-for-linux/issues/3501
|
||||
# rm -vf ~user/.local/share/Steam/config/config.vdf
|
||||
|
||||
# Use libgcrypt provided by the Steam docker image (needed by HL1 engine games)
|
||||
LD_PRELOAD="$LD_PRELOAD:/lib/i386-linux-gnu/libgcrypt.so.11:/lib/x86_64-linux-gnu/libgcrypt.so.11"
|
||||
export LD_PRELOAD
|
||||
# LD_PRELOAD=$LD_PRELOAD:$(for LIB in ${PRELOAD_LIBS:-libnvidia-glcore.so tls/libnvidia-tls.so libGLX_nvidia.so}; do find /hostlibs -type f -iregex ".*/${LIB}.*" -print0; done | tr '\0' ':' ; echo)
|
||||
# su -l user -c "HOME=/home/user STEAM_RUNTIME=${STEAM_RUNTIME:-1} LD_PRELOAD=$LD_PRELOAD steam $@" |& grep -v 'wrong ELF class'
|
||||
|
||||
#
|
||||
# Try to load host's libGL (generic or Nvidia 32/64-bit) drivers
|
||||
#
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(echo /h{1..20}_{32,64} | tr ' ' ':')"
|
||||
export LD_LIBRARY_PATH
|
||||
# LD_PRELOAD does not work well when you want to use Proton (modified version of Wine created by Steam)
|
||||
# When running the games with Proton, they will fail with:
|
||||
# "wine: Unhandled page fault on read access to 0x00000000 at address 0xf5c1c2b6 (thread 0009), starting debugger..."
|
||||
# This is due to a mix of our LD_PRELOAD and Proton's. They add ".local/share/Steam/ubuntu12_{32,64}/gameoverlayrenderer.so".
|
||||
|
||||
#
|
||||
# In order to avoid the inconsistency error, when launching `csgo_linux64`
|
||||
# Inconsistency detected by ld.so: dl-open.c: 689: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
|
||||
# Hint: to find out what's wrong, use `strace`
|
||||
#
|
||||
# 1) Try to load host's Pulse library instead of the one from this image
|
||||
export LD_PRELOAD="$LD_PRELOAD:$(find /h{1..20}_{32,64} -type f -name "*libpulsecommon*" -print0 2>/dev/null| tr '\0' ':')"
|
||||
|
||||
# BUGFIX: Steam is searching for libfreeblpriv3.so in tls/ directory
|
||||
ln -sv /usr/lib/x86_64-linux-gnu/nss /usr/lib/x86_64-linux-gnu/tls
|
||||
ln -sv /usr/lib/i386-linux-gnu/nss /usr/lib/i386-linux-gnu/tls
|
||||
|
||||
su -p user -c "steam $@"
|
||||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/hostlibs/32:/hostlibs/64:"
|
||||
su -l user -c "HOME=/home/user STEAM_RUNTIME=${STEAM_RUNTIME:-1} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} steam $@" |& grep -v 'wrong ELF class'
|
||||
|
Loading…
Reference in new issue