make it driver independent
This commit is contained in:
parent
7aff8ad616
commit
bb3f8c0426
29
Dockerfile
29
Dockerfile
@ -39,33 +39,6 @@ RUN echo "deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise stea
|
||||
# Not sure whether we really need these:
|
||||
# libcurl3 libcanberra-gtk-module
|
||||
|
||||
# Install NVIDIA Drivers.
|
||||
# Currently supported versions: 304, 340, 361 (both 32 & 64 bit)
|
||||
# TODO: use debian mirrors if possible?
|
||||
|
||||
# amd64 (comes along with the i386)
|
||||
ADD http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-304/nvidia-304_304.131-0ubuntu4_amd64.deb /tmp/nvidia-304.deb
|
||||
ADD http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-340/nvidia-340_340.96-0ubuntu6_amd64.deb /tmp/nvidia-340.deb
|
||||
ADD http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-361/nvidia-361_361.42-0ubuntu2_amd64.deb /tmp/nvidia-361.deb
|
||||
|
||||
# Newer
|
||||
# ADD http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-361/nvidia-361_361.45.11-0ubuntu4_amd64.deb /tmp/nvidia-361.deb
|
||||
|
||||
RUN cd /tmp && \
|
||||
ar xv nvidia-304.deb data.tar.xz && \
|
||||
tar xf data.tar.xz -C / && \
|
||||
rm -f data.tar.xz nvidia-304.deb
|
||||
|
||||
RUN cd /tmp && \
|
||||
ar xv nvidia-340.deb data.tar.xz && \
|
||||
tar xf data.tar.xz -C / && \
|
||||
rm -f data.tar.xz nvidia-340.deb
|
||||
|
||||
RUN cd /tmp && \
|
||||
ar xv nvidia-361.deb data.tar.xz && \
|
||||
tar xf data.tar.xz -C / && \
|
||||
rm -f data.tar.xz nvidia-361.deb
|
||||
|
||||
# Workaround missing lib in .local/share/Steam/ubuntu12_32/steamclient.so
|
||||
RUN ln -sv libudev.so.1 /lib/i386-linux-gnu/libudev.so.0
|
||||
|
||||
@ -104,4 +77,4 @@ WORKDIR $HOME
|
||||
ENV STEAM_RUNTIME 0
|
||||
|
||||
COPY ./launch /launch
|
||||
ENTRYPOINT [ "/bin/sh", "/launch" ]
|
||||
ENTRYPOINT [ "/bin/bash", "/launch" ]
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Steam in Docker
|
||||
|
||||
Tested in Ubuntu 16.04 LTS (64bit) with the following GPU's:
|
||||
Tested in Ubuntu 16.04 LTS (64bit) and openSUSE Leap 42.1
|
||||
with the following GPU's:
|
||||
|
||||
- Intel HD Graphics 3000
|
||||
- Intel HD Graphics 4400
|
||||
@ -12,10 +13,6 @@ Tested in Ubuntu 16.04 LTS (64bit) with the following GPU's:
|
||||
- [Docker](https://www.docker.com/)
|
||||
- (Optional) [Docker Compose](https://docs.docker.com/compose/)
|
||||
|
||||
## Limitations
|
||||
|
||||
- The version of your Nvidia drivers should match the ones in Dockerfile used to build this image.
|
||||
Currently this image supports these versions of the NVIDIA driver: 304, 340, 361.
|
||||
|
||||
# Building and launching Steam
|
||||
|
||||
|
@ -15,12 +15,28 @@ services:
|
||||
- /dev/shm:/dev/shm
|
||||
- data:/home
|
||||
# - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
|
||||
# Ubuntu's NVIDIA driver:
|
||||
- /usr/lib/nvidia-361-prime:/h1:ro
|
||||
- /usr/lib/nvidia-340:/h2:ro
|
||||
- /usr/lib/nvidia-340-prime:/h3:ro
|
||||
- /usr/lib/nvidia-304:/h4:ro
|
||||
- /usr/lib32/nvidia-361:/h5:ro
|
||||
- /usr/lib32/nvidia-340:/h6:ro
|
||||
- /usr/lib32/nvidia-304:/h7:ro
|
||||
# openSUSE's NVIDIA driver:
|
||||
- /usr/X11R6/lib:/h10:ro
|
||||
- /usr/X11R6/lib64:/h11:ro
|
||||
- /usr/lib:/h12:ro
|
||||
- /usr/lib64:/h13:ro
|
||||
# Ubuntu's generic libGL:
|
||||
- /usr/lib/x86_64-linux-gnu:/h8:ro
|
||||
- /usr/lib/i386-linux-gnu:/h9:ro
|
||||
devices:
|
||||
# - /dev/nvidia0
|
||||
# - /dev/nvidiactl
|
||||
# - /dev/nvidia-uvm
|
||||
- /dev/nvidia0
|
||||
- /dev/nvidiactl
|
||||
- /dev/nvidia-uvm
|
||||
# uncomment this when running NVIDIA Driver >= 361
|
||||
# - /dev/nvidia-modeset
|
||||
- /dev/nvidia-modeset
|
||||
- /dev/dri
|
||||
# - /dev/snd
|
||||
environment:
|
||||
|
36
launch
36
launch
@ -1,13 +1,16 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# So that errors will be visible on `docker logs -f steam` command
|
||||
#
|
||||
# Make errors visible upon `docker logs -f steam` command
|
||||
#
|
||||
exec 2>&1
|
||||
|
||||
#
|
||||
# befriend with grsec
|
||||
# Befriend with grsecurity patched Linux kernel
|
||||
#
|
||||
# TODO: find a way how to set these attributes dynamically,
|
||||
# since currently it will require Steam restart when new content is obtained.
|
||||
# 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
|
||||
@ -21,11 +24,26 @@ if [ -f /proc/sys/kernel/grsecurity/tpe_gid ]; then
|
||||
fi
|
||||
|
||||
#
|
||||
# This part is very important, since this lets Steam choose proper nvidia drivers (32 or 64 bit)
|
||||
# Add a user to a detected "video" group
|
||||
# so that it can access the nvidia devices
|
||||
#
|
||||
# echo "$(find /usr/lib /usr/lib32 -maxdepth 1 -type d -name "*nvidia*" -print0 |tr '\0' ':' ; echo)"
|
||||
# export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/nvidia-361:/usr/lib/nvidia-361-prime:/usr/lib/nvidia-340:/usr/lib/nvidia-340-prime:/usr/lib/nvidia-304:/usr/lib32/nvidia-361:/usr/lib32/nvidia-340:/usr/lib32/nvidia-304:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu"
|
||||
export LD_LIBRARY_PATH="/usr/lib/nvidia-361:/usr/lib/nvidia-361-prime:/usr/lib/nvidia-340:/usr/lib/nvidia-340-prime:/usr/lib/nvidia-304:/usr/lib32/nvidia-361:/usr/lib32/nvidia-340:/usr/lib32/nvidia-304:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu"
|
||||
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
|
||||
|
||||
#
|
||||
# This part is very important,
|
||||
# since this lets Steam choose proper nvidia drivers (32 or 64 bit)
|
||||
#
|
||||
# Make sure the Steam docker image's paths are coming first
|
||||
# and then the hosts's (/h1..20) mounted ones
|
||||
export LD_LIBRARY_PATH="/usr/lib:/lib/i386-linux-gnu:/lib/x86_64-linux-gnu:$(echo /h{1..20} | tr ' ' ':')"
|
||||
|
||||
su -p user -c "steam $@"
|
||||
# exec su -p user -c "steam $@"
|
||||
|
Loading…
Reference in New Issue
Block a user