uureel / batocera-containers

containers for x64 batocera 36/37/38/39: ubuntu, debian, alpine, arch, plex, jellyfin
https://batocera.pro/containers
GNU General Public License v3.0
11 stars 1 forks source link

batocera-emby #2

Closed udance4ever closed 2 months ago

udance4ever commented 4 months ago

great work on batocera-plex & batocera-jellyfin! more props up here :)

Could you publish the steps/framework/script you use to create your app images? id like to help create batocera-emby!

I was able to use the docker that is part of batocera-plex to download & create an Emby container - I've looked at the Emby log files created and I don't see any red flags - it's up & running but for some reason I can't access the web UI even though I've published port 8096 (and batocera-jellyfin works & isn't running as Im aware it defaults to the same port (I've changed it to 8098 anyways)).

I verified the way I created the Emby container pulls up the web UI no prob in ElementaryOS 6.1 (Ubuntu 20.04 under the hood) so a bit puzzled what you're doing differently.

udance4ever commented 4 months ago

update on this front - I got the embyserver container working after starting batocera-jellyfin after a fresh reboot! both servers are running successfully on ports 8096 and 8098 respectively.

what changed is I started to play around with batocera-cli

the irony is when I used the newer version of docker in the CLI utilities (is it because it’s targeted for ubuntu22?), docker run died on me reporting:

docker: unknown server OS: .
See 'docker run --help'.

so out of curiosity, I rebooted, ran batocera-jellyfin and reran the command that had failed before:

docker run -d \
        --name embyserver \
        --volume /userdata/system/emby:/config \
        --volume /userdata/kodi:/userdata/kodi \
        --device /dev/dri:/dev/dri \
        --publish 8096:8096 \
        --publish 8920:8920 \
        --env UID=0 \
        --env GID=0 \
        --restart unless-stopped \
                emby/embyserver:latest

this time the container published on port 8096 successfully.

since you know the inner workings of batocera-cli - can you think of any reason why the Emby container would work after installing the CLI utilities? I looked at the symlinks batocera-cli creates in /usr/bin and clearly they’ve been reset after reboot and the only symlinks I see point into ~/.config/jellyfin/bin (which is to be expected)

I’ll reconfigure my custom.sh so it boots Emby & Jellyfin (and PLEX for good measure :) to help stress test it and see if they all continue to stay up on every reboot (so far so good!)

I’d love to still contribute to creating batocera-emby

I’m on an early 2015 MacBook Pro in Batocera v38. If there’s any other system info you need, let me know.

uureel commented 4 months ago

hi, you can check each container appimage using file.AppImage --appimage-extract, this will get you a squashfs-root directory with the AppRun file in there, which is the main script, running everything;

tldr, it just live symlinks podman with all dependencies into batocera, then runs the launch command for the container, with some custom stuff optional; (to repack the squashfs-root into an appimage - check out appimagetool)

batocera-cli has a much wider set of tools included (and updated docker/podman also with some differences in config files regarding containers), and so it's more so meant for playing with containers straight from cli, while the appimages are just, rather meant to be a single-focused aio package w/minimal exposure to docker/podman, similarly you can check entire cli package via the ~/cli/run file

udance4ever commented 4 months ago

hey thanks for all this input to unpack the AppImage! I'll use this as an exercise to learn how to build an AppImage.

I'm thinking the "unknown server OS: ." error is dependency related so I'll be sure to pack the same version of docker you have in batocera-jellyfin.

udance4ever commented 4 months ago

hey I’ve been doing some experimenting the last few hours…

I tried to use the new convention for batocera-services and put batocera-plex and batocera-jellyfin in /userdata/system/services/{plex,jellyfin} and enabled them both in ES and rebooted. Jellyfin came up and Plex never started and realized that it’s possible both AppImages might be bashing each other trying to set up docker? (I don’t know if service setup happens concurrently or not)

so I turned to this recommendation to create a docker service in ES using this script:

#!/bin/bash

start() {
        if [[ "$(pidof dockerd)" = "" ]]; then
                if [[ -e "$(which dockerd)" ]]; then
                        nohup dockerd 1>/dev/null 2>/dev/null &
                else
                        ~/cli/run |& tee ~/logs/docker-service.log
                fi
        else
                docker unpause $(docker ps -q)
        fi
}

stop() {
        docker pause $(docker ps -q)
}

case "$1" in
start)
        start &
        ;;
stop)
        stop
        ;;
*)
        echo "Usage: $0 {start|stop}"
        exit 1
esac

the only issue I’m dealing with right now is the service script is not starting by itself on boot and I have to manually start the service but I’ll get this ironed out.

Do you happen to know how to define a service dependency in batocera-services?

uureel commented 3 months ago

reworking some stuff, will be releasing batocera-casaos sometime soon, all sorts of media containers and more will be covered there image

udance4ever commented 3 months ago

OMG! thank you for the update & ptr! just logged into the demo & sooooooooo glad to see Home Assistant alongside Jellyfin. (and PhotoPrism, just learned about it yesterday - the synchronicity!)

Ive been a firm believer of the "personal data locker" concept Siegel coined in his book Pull (he's not the pioneer, just did a great job framing it for the masses as a writer) so the idea of a "personal data center" brings the idea to a whole new echelon!!

While I get the complexities of putting Batocera in a container - it sure sounds like this future is getting closer 😇

starred the repo & happy to contribute at a pace I can - catching up w the open source world via the cloud of repos that surround Batocera & diving back into the tinkerer/maker in me the past 2 weeks has been super intense - fulfilling but exhausting.

Seeing projects like CasaOS truly make me feel I'm not alone in what I'm building so thanks again for shedding light 🏡🏕️

UPDATE: CasaOS runs great on Ubuntu Server 22.04.4 LTS. evaluated the lionshare of containers - what I think is really neat about container customization is how much easier it is to create apps that aggregate/synthesize user data via a local service. this is a huge step up from typical app stores that do so much sandboxing, it's hard to define "synthesis" services. While there is a ways to go to fulfill on such a vision, I love the foundation I see in the first 24 hrs (but lost sleep jumping down the rabbit hole! lol🐰)

ok when I find the cycles, I still want to follow your original instructions above to go under the hood of the batocera-jellyfin AppImage & create batocera-emby so it works in system/services. good segue way 😉

uureel commented 3 months ago

wanna test? image

udance4ever commented 2 months ago

wanna test? image

oh wow - this is exciting! I’ve been testing CasaOS on my dev server over the last week & successfully migrated all my containers on my main server & got secure tunnel set up easy peasy thanks to Wireguard Easy and DuckDNS.

I accept the challenge to try out CasaOS for Batocera! this might be the easier path to batocera-emby 😉

udance4ever commented 2 months ago

CasaOS running in Batocera is amazing! I can’t wait to navigate CasaOS with a gamepad 🕹️ super impressed with startup time as it looks like you bootstrap enough to get podman up to launch CasaOS and it’s all very speedy! 🏎️

I’ve got some feedback I’d love to log somewhere - where would you like me to start a thread?

I’m closing out this specific issue as the idea of creating batocera-emby the ole fashioned way doesn’t make any sense any more when you can go the CasaOS route and get so much more thrown in the sink! 🛠️

kudos to the Batocera Pro dev team! 🥇