-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
290896e
commit fe5806e
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
FROM unityci/editor:ubuntu-2021.2.12f1-linux-il2cpp-1 | ||
|
||
# updating apt with steam packages | ||
RUN apt-get -q update \ | ||
&& apt-get -q install -y gnupg2 \ | ||
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B05498B7 \ | ||
&& wget -O /usr/share/keyrings/steam.gpg https://repo.steampowered.com/steam/archive/stable/steam.gpg \ | ||
&& echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam" > /etc/apt/sources.list.d/steam-stable.list \ | ||
&& echo "deb-src [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam" >> /etc/apt/sources.list.d/steam-stable.list \ | ||
&& apt-get -q update \ | ||
&& apt-get -q install -y software-properties-common \ | ||
&& add-apt-repository multiverse \ | ||
&& dpkg --add-architecture i386 \ | ||
&& apt-get -q update | ||
|
||
# install xserver | ||
RUN apt-get -q install -y xserver-xorg xserver-xorg-video-dummy xfonts-base curl | ||
|
||
# create dummy xserver config | ||
RUN echo 'Section "Monitor"' > /etc/X11/xorg.conf \ | ||
&& echo ' Identifier "Monitor0"' >> /etc/X11/xorg.conf \ | ||
&& echo ' HorizSync 28.0-80.0' >> /etc/X11/xorg.conf \ | ||
&& echo ' VertRefresh 48.0-75.0' >> /etc/X11/xorg.conf \ | ||
&& echo ' # https://arachnoid.com/modelines/' >> /etc/X11/xorg.conf \ | ||
&& echo ' # 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz' >> /etc/X11/xorg.conf \ | ||
&& echo ' Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync' >> /etc/X11/xorg.conf \ | ||
&& echo 'EndSection' >> /etc/X11/xorg.conf \ | ||
&& echo 'Section "Device"' >> /etc/X11/xorg.conf \ | ||
&& echo ' Identifier "Card0"' >> /etc/X11/xorg.conf \ | ||
&& echo ' Driver "dummy"' >> /etc/X11/xorg.conf \ | ||
&& echo ' VideoRam 256000' >> /etc/X11/xorg.conf \ | ||
&& echo 'EndSection' >> /etc/X11/xorg.conf \ | ||
&& echo 'Section "Screen"' >> /etc/X11/xorg.conf \ | ||
&& echo ' DefaultDepth 24' >> /etc/X11/xorg.conf \ | ||
&& echo ' Identifier "Screen0"' >> /etc/X11/xorg.conf \ | ||
&& echo ' Device "Card0"' >> /etc/X11/xorg.conf \ | ||
&& echo ' Monitor "Monitor0"' >> /etc/X11/xorg.conf \ | ||
&& echo ' SubSection "Display"' >> /etc/X11/xorg.conf \ | ||
&& echo ' Depth 24' >> /etc/X11/xorg.conf \ | ||
&& echo ' Modes "1920x1080_60.00"' >> /etc/X11/xorg.conf \ | ||
&& echo 'EndSubSection' >> /etc/X11/xorg.conf \ | ||
&& echo 'EndSection' >> /etc/X11/xorg.conf | ||
|
||
# upgrade libstdc++6 | ||
RUN apt-get -q update \ | ||
&& apt-get -q install -y --no-install-recommends software-properties-common \ | ||
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \ | ||
&& apt-get -q install -y --only-upgrade libstdc++6 \ | ||
&& apt-get -q install -y libstdc++6:i386 \ | ||
&& add-apt-repository -y --remove ppa:ubuntu-toolchain-r/test \ | ||
&& apt-get -q remove -y --auto-remove software-properties-common \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# download and install steam client | ||
RUN apt-get -q update \ | ||
&& apt-get -q install -y libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1-mesa-glx:amd64 libgl1-mesa-glx:i386 steam-launcher | ||
|
||
# install tmux | ||
RUN apt-get -q install -y tmux sudo lsof pciutils | ||
|
||
# install utilities | ||
RUN apt-get -q install -y sed | ||
|
||
# create gamer user | ||
# RUN adduser --disabled-password --gecos "" gamer \ | ||
# && usermod -s /bin/bash gamer | ||
|
||
# add gamer to sudoers file | ||
# RUN echo '#!/usr/bin/env bash' > /usr/bin/cudo.sh \ | ||
# && echo 'echo "$1" | (EDITOR="tee -a" visudo)' >> /usr/bin/cudo.sh \ | ||
# && chmod +x /usr/bin/cudo.sh \ | ||
# && cudo.sh 'gamer ALL=(ALL) NOPASSWD:ALL' | ||
|
||
# making root home dir public to give access for steam | ||
# RUN chmod og+rwx /root | ||
|
||
# patch steam to allow running as root | ||
RUN sed -i "/Don't allow running as root/{n;N;N;N;s/.*/# Deleted by a script/;}" /usr/bin/steam | ||
|
||
# install steam deps | ||
RUN apt-get -q install -y curl python-apt xterm xz-utils zenity \ | ||
&& apt-get -q install -y libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libc6:i386 \ | ||
wget libgl1-mesa-glx:i386 libcurl4-openssl-dev pkg-config libegl1:i386 libgbm1:i386 \ | ||
xdg-desktop-portal xdg-desktop-portal-gtk at-spi2-core libglx-mesa0:i386 libgl1-mesa-dri:i386 \ | ||
libstdc++6:i386 libgl1:i386 zenity libgdk-pixbuf2.0-0 libgtk-3-0 libnotify4 libwebkit2gtk-4.0-37 | ||
|
||
# run steam for the first time | ||
RUN X -config /etc/X11/xorg.conf & sleep 5 \ | ||
&& export DISPLAY=:0 \ | ||
&& steam & sleep 200 | ||
|
||
# stop steam & X | ||
RUN echo ~ \ | ||
&& ls -la ~/ \ | ||
&& ls -la ~/.steam \ | ||
&& ( kill -9 $(cat ~/.steam/steam.pid) || true ) \ | ||
&& ( kill -9 $(lsof -ti:8081 /tmp/.X11-unix/X0) || true ) | ||
|
||
# move steam init config to another folder | ||
RUN mkdir -p /var/local/home_template/root \ | ||
&& mv ~/.local /var/local/home_template/root \ | ||
&& mv ~/.steam /var/local/home_template/root \ | ||
&& mv ~/.steampath /var/local/home_template/root \ | ||
&& mv ~/.steampid /var/local/home_template/root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters