-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
55 lines (45 loc) · 2.35 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM ubuntu
MAINTAINER Antoine Webanck <[email protected]>
# Parameterizing docker build.
ARG PROTON_USER_UID=1001
ARG GPU_TYPE=NVIDIA
# Creating the proton user and setting up dedicated non-root environment: replace 1001 by your user id (id -u) for X sharing.
RUN useradd -u "$PROTON_USER_UID" -d /home/proton -m -s /bin/bash proton
ENV HOME=/home/proton
WORKDIR /home/proton
# Setting up an alias to launch Steam easily.
RUN su proton -c "echo 'alias steam=\"/usr/games/steam\"' >> /home/proton/.bashrc"
# Adding the link to the pulseaudio server for the client to find it.
ENV PULSE_SERVER=unix:/run/user/"$PROTON_USER_UID"/pulse/native
#########################START INSTALLATIONS##########################
# We don't want any interaction from package installation during the docker image building.
ARG DEBIAN_FRONTEND=noninteractive
# We need the 32 bits architecture to allow steam.
RUN dpkg --add-architecture i386 && \
# Updating and upgrading a bit.
apt-get update && \
# apt-get upgrade -y &&
# We need software-properties-common to add ppas and wget and apt-transport-https to add repositories and their keys.
apt-get install -y --no-install-recommends gpg-agent software-properties-common apt-transport-https wget && \
# Adding required ppas: graphics drivers (for Nvidia GPU).
( [ "$GPU_TYPE" = NVIDIA ] && add-apt-repository ppa:graphics-drivers/ppa && apt-get update || true ) && \
# Installation of graphics driver (Nvidia or Intel chipsets).
( \
[ "$GPU_TYPE" = NVIDIA ] && apt-get install -y --no-install-recommends initramfs-tools nvidia-driver-460 || \
[ "$GPU_TYPE" = INTEL ] && apt-get install -y --no-install-recommends libgl1-mesa-glx libgl1-mesa-dri mesa-vulkan-drivers mesa-vulkan-drivers:i386 \
) && \
# Installation of pulseaudio support for sound.
apt-get install -y --no-install-recommends pulseaudio && \
sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/daemon.conf && \
sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf && \
# Installation of steam.
apt-get install -y steam && \
# Cleaning up.
apt-get autoremove -y --purge software-properties-common && \
apt-get autoremove -y --purge && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#########################END OF INSTALLATIONS##########################
# Launching the shell by default as proton user.
USER proton
CMD /bin/bash