Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Fix dbus, xserver and pulseudio startup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjohiryan committed Sep 24, 2023
1 parent 0996160 commit 0091b0c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
20 changes: 15 additions & 5 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV TZ UTC

ARG USERNAME=admin
ARG USER_UID=1000
ARG USER_GID=${USER_UID}

#
#Add dependencies
#
Expand All @@ -59,11 +63,17 @@ RUN apt-get update; \
apt-get install -y --no-install-recommends \
#
#Xserver
wget ca-certificates xvfb dbus-user-session dbus-x11 libdbus-c++-1-0v5 xorg openbox\
wget vim ca-certificates software-properties-common gpg-agent xvfb dbus-user-session dbus-x11 libdbus-c++-1-0v5\
#
#Pulseaudio
pulseaudio libcairo2 libxcb1 libxrandr2 libxv1 libopus0 libvpx6; \
#
# workaround for an X11 problem: http://blog.tigerteufel.de/?p=476
#
mkdir /tmp/.X11-unix; \
chmod 1777 /tmp/.X11-unix; \
chown $USERNAME /tmp/.X11-unix/; \
#
# Housekeeping
#
apt-get clean -y; \
Expand All @@ -77,10 +87,6 @@ RUN apt-get update; \
/usr/share/man/* \
/usr/share/local/*

ARG USERNAME=admin
ARG USER_UID=1000
ARG USER_GID=${USER_UID}

#
#Create a non-root user `admin`
#
Expand Down Expand Up @@ -143,6 +149,10 @@ STOPSIGNAL SIGRTMIN+3
COPY temp/warp /usr/bin/
COPY docker/base/ffmpeg.sh /scripts/
RUN chmod +x /scripts/ffmpeg.sh /usr/bin/warp

COPY docker/base/dbus /usr/bin/dbus
COPY docker/base/default.pa /etc/pulse/

#
#Copy the systemd.service file for starting the server
#
Expand Down
11 changes: 11 additions & 0 deletions docker/base/dbus
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if [ ! -d /var/run/dbus ]; then
mkdir -p /var/run/dbus
fi

if [ -f /var/run/dbus/pid ]; then
rm -f /var/run/dbus/pid
fi

/usr/bin/dbus-daemon --nofork --print-pid --config-file=/usr/share/dbus-1/system.conf
10 changes: 10 additions & 0 deletions docker/base/default.pa
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/pulseaudio -nF

### Create virtual output device sink
load-module module-null-sink sink_name=audio_output sink_properties=device.description="Virtual\ Audio\ Output"

# Allow pulse audio to be accessed via TCP (from localhost only), to allow other users to access the virtual devices
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

0 comments on commit 0091b0c

Please sign in to comment.