Skip to content

Commit

Permalink
fix with dbus
Browse files Browse the repository at this point in the history
  • Loading branch information
sytone committed Mar 19, 2022
1 parent 707785c commit 53d764a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ LABEL org.opencontainers.image.description="Hosted Obsidian instance allowing ac

RUN \
echo "**** install packages ****" && \
# Update and install extra packages.
apt-get update && \
apt-get install --no-install-recommends -y \
apt-get install -y --no-install-recommends \
# Packages needed to download and extract obsidian.
curl \
libnss3 && \
libnss3 \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
echo "**** cleanup ****" && \
apt-get autoclean && \
rm -rf \
Expand All @@ -40,7 +45,8 @@ RUN \
ENV \
CUSTOM_PORT="8080" \
GUIAUTOSTART="true" \
HOME="/vaults"
HOME="/vaults" \
TITLE="Obsidian v$OBSIDIAN_VERSION"

# add local files
COPY root/ /
Expand Down
2 changes: 1 addition & 1 deletion root/defaults/autostart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/squashfs-root/obsidian --no-sandbox
/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer
17 changes: 17 additions & 0 deletions root/etc/cont-init.d/90-dbus
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bash

# Generate machine-id
rm /etc/machine-id > /dev/null 2>&1 || true
dbus-uuidgen > /var/lib/dbus/machine-id
ln -s /var/lib/dbus/machine-id /etc/machine-id

# Ensure pid file is removed
rm /var/run/dbus/pid > /dev/null 2>&1 || true

# Ensure directory structure is present
mkdir -p /var/run/dbus

# Ensure messagebus user exists
if ! id "messagebus" &>/dev/null; then
useradd -r --no-create-home -U messagebus
fi
5 changes: 5 additions & 0 deletions root/etc/services.d/dbus/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash

# Start dbus
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address --nofork

0 comments on commit 53d764a

Please sign in to comment.