owntone / owntone-container

Workflows and artifacts of the containerisation of OwnTone
https://owntone.github.io/owntone-server
10 stars 2 forks source link

owntone doesn't start with the latest docker image. #6

Open tsuyo-o opened 4 weeks ago

tsuyo-o commented 4 weeks ago

With the latest docker image, owntone didn't start because avahi-daemon failed to start. And after adding "--no-drop-root" to command_args_background in /etc/init.d/avahi-daemon and mount /var/run/dbus/system_bus_socket, it became functional. I'm using docker on Arch Linux and hope this will help someone who has the same issue.

/etc/init.d/avahi-daemon

#!/sbin/openrc-run

name="${RC_SVCNAME}"
description="Avahi Daemon"

pidfile="/run/${RC_SVCNAME}/pid"
dbussocket="/run/dbus/system_bus_socket"

command="/usr/sbin/avahi-daemon"
command_args_background="-D --no-drop-root"

start_pre() {
        if [ ! -S "${dbussocket}" ]; then
          sleep 15
          start_pre
        fi
        return 0
}

depend() {
        before netmount nfsmount
        use net
        need dbus
}

docker-compose.yaml

services:
  owntone:
    image: docker.io/owntone/owntone:latest
    volumes:
      - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
      - ./avahi-daemon:/etc/init.d/avahi-daemon
      - ./config:/etc/owntone
      - ./db:/var/cache/owntone
      - ./playlist:/Playlist
      - /data/Music:/Music:ro
    ports:
      - 3688:3688
      - 3689:3689
    restart: unless-stopped
hacketiwack commented 3 weeks ago

I don't face any of these problems and I'm also running it on Arch Linux. As you are on Arch Linux, my recommendation would be to use podman with systemd quadlets to run your containers.