Improvements to Debian Docker image build.

Add changes from Arch dockerfile:
- Flatpak support
- Reduce unnecessary recommends installations
- Separate mesa and vulkin installations
This commit is contained in:
Josh.5
2022-01-26 16:48:21 +13:00
parent 5213e1c9f7
commit 552714c75f
4 changed files with 102 additions and 47 deletions

View File

@@ -1,4 +1,5 @@
FROM debian:bullseye-slim
LABEL maintainer="Josh.5 <jsunnex@gmail.com>"
# Update package repos
ARG DEBIAN_FRONTEND=noninteractive
@@ -16,7 +17,6 @@ RUN \
echo "**** Install and configure locals ****" \
&& apt-get install -y --no-install-recommends \
locales \
procps \
&& echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \
&& locale-gen \
&& \
@@ -59,20 +59,19 @@ RUN \
&& apt-get update \
&& \
echo "**** Install tools ****" \
&& apt-get install -y --reinstall \
&& apt-get install -y --no-install-recommends \
bash \
bash-completion \
curl \
gcc \
git \
kmod \
less \
make \
man-db \
mlocate \
nano \
python3 \
python3-numpy \
python3-pip \
python3-setuptools \
net-tools \
patch \
pciutils \
procps \
rsync \
sudo \
unzip \
@@ -80,6 +79,13 @@ RUN \
wget \
xz-utils \
&& \
echo "**** Install python ****" \
&& apt-get install -y --no-install-recommends \
python3 \
python3-numpy \
python3-pip \
python3-setuptools \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
@@ -109,6 +115,42 @@ RUN \
&& \
echo
# Install mesa requirements
RUN \
echo "**** Update apt database ****" \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& \
echo "**** Install mesa and vulkan requirements ****" \
&& apt-get install -y --no-install-recommends \
libegl1 \
libgl1-mesa-dri \
libgl1-mesa-dri:i386 \
libgl1-mesa-glx \
libglu1-mesa \
libglx-mesa0:i386 \
libgtk-3-0 \
libgtk2.0-0 \
libsdl2-2.0-0 \
libvulkan1 \
libvulkan1:i386 \
mesa-utils \
mesa-utils-extra \
mesa-vulkan-drivers \
mesa-vulkan-drivers:i386 \
vainfo \
vulkan-tools \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Install X Server requirements
RUN \
echo "**** Update apt database ****" \
@@ -118,17 +160,8 @@ RUN \
&& apt-get install -y --no-install-recommends \
avahi-utils \
dbus-x11 \
libgl1-mesa-dri \
libgl1-mesa-glx \
libglu1-mesa \
libxcomposite-dev \
libxcursor1 \
man-db \
mesa-utils \
mesa-utils-extra \
mlocate \
net-tools \
pciutils \
pkg-config \
x11-xfs-utils \
x11vnc \
@@ -245,28 +278,22 @@ RUN \
/tmp/websockify-* \
/tmp/websockify.tar.gz
# Install Steam
# Add support for flatpaks
RUN \
echo "**** Install steam ****" \
&& dpkg --add-architecture i386 \
echo "**** Update apt database ****" \
&& apt-get update \
&& echo steam steam/question select "I AGREE" | debconf-set-selections \
&& echo steam steam/license note '' | debconf-set-selections \
&& \
echo "**** Install flatpak support ****" \
&& apt-get install -y \
libegl1 \
libgl1-mesa-dri:i386 \
libglx-mesa0:i386 \
libgtk-3-0 \
libgtk2.0-0 \
libsdl2-2.0-0 \
libvulkan1 \
libvulkan1:i386 \
mesa-vulkan-drivers \
mesa-vulkan-drivers:i386 \
vulkan-tools \
&& apt-get install -y \
steam \
steam-devices \
bridge-utils \
flatpak \
libpam-cgfs \
libvirt0 \
lxc \
uidmap \
&& \
echo "**** Configure flatpak ****" \
&& chmod u+s /usr/bin/bwrap \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
@@ -301,6 +328,28 @@ RUN \
&& \
echo
# Install Steam
RUN \
echo "**** Install steam ****" \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& echo steam steam/question select "I AGREE" | debconf-set-selections \
&& echo steam steam/license note '' | debconf-set-selections \
&& apt-get install -y \
&& apt-get install -y \
steam \
steam-devices \
&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
# Install firefox
RUN \
echo "**** Update apt database ****" \
@@ -397,6 +446,7 @@ ENV \
# Be sure that the noVNC port is exposed
EXPOSE 8083
EXPOSE 5901
EXPOSE 32123
# Set entrypoint

View File

@@ -5,8 +5,8 @@
# File Created: Saturday, 8th January 2022 2:34:23 pm
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Friday, 14th January 2022 8:53:16 am
# Modified By: Josh.5 (jsunnex@gmail.com)
# Last Modified: Wednesday, 26th January 2022 3:55:24 pm
# Modified By: Console and webGui login account (jsunnex@gmail.com)
###
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
@@ -16,6 +16,7 @@ project_base_path=$(realpath ${script_path}/..);
# Parse params
additional_docker_params=""
container_name="steam"
tag="develop"
for ARG in ${@}; do
case ${ARG} in
*primary)
@@ -42,6 +43,12 @@ for ARG in ${@}; do
root)
script_mode="root"
;;
*arch)
tag="arch";
;;
*debian)
tag="debian";
;;
*)
;;
esac
@@ -57,12 +64,9 @@ else
fi
if [[ "${hostx}" == "true" ]]; then
container_name="${container_name}-hx"
additional_docker_params="${additional_docker_params} -v /tmp/.X11-unix:/tmp/.X11-unix"
additional_docker_params="${additional_docker_params} -e MODE=secondary"
nvidia="false"
framebuffer="false"
else
additional_docker_params="${additional_docker_params} -v /tmp/headless/.X11-unix:/tmp/.X11-unix"
fi
if [[ "${nvidia}" == "true" ]]; then
container_name="${container_name}-hw"
@@ -128,9 +132,10 @@ cmd="docker run -d --name='${container_name}' \
-v '/tmp/.X11-unix/':'/tmp/.X11-unix/':'rw' \
-v '/dev/input':'/dev/input':'ro' \
--hostname='${container_name}' \
--add-host=${container_name}:127.0.0.1 \
--shm-size=2G \
${additional_docker_params} \
josh5/steam-headless:develop"
josh5/steam-headless:${tag}"
echo ${cmd}
bash -c "${cmd}"

View File

@@ -27,22 +27,22 @@
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/images/desktop-base/default"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/steam.jpg"/>
</property>
<property name="workspace1" type="empty">
<property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/images/desktop-base/default"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/steam.jpg"/>
</property>
<property name="workspace2" type="empty">
<property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/images/desktop-base/default"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/steam.jpg"/>
</property>
<property name="workspace3" type="empty">
<property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/images/desktop-base/default"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/steam.jpg"/>
</property>
</property>
</property>

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB