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

View File

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

View File

@@ -27,22 +27,22 @@
<property name="workspace0" type="empty"> <property name="workspace0" type="empty">
<property name="color-style" type="int" value="1"/> <property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/> <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 name="workspace1" type="empty"> <property name="workspace1" type="empty">
<property name="color-style" type="int" value="1"/> <property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/> <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 name="workspace2" type="empty"> <property name="workspace2" type="empty">
<property name="color-style" type="int" value="1"/> <property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/> <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 name="workspace3" type="empty"> <property name="workspace3" type="empty">
<property name="color-style" type="int" value="1"/> <property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="5"/> <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> </property>
</property> </property>

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB