Skip to content

Add Posterizarr Container with Multi-Architecture Support#254

Merged
onedr0p merged 18 commits intohome-operations:mainfrom
dapperdivers:posterizarr
Mar 27, 2025
Merged

Add Posterizarr Container with Multi-Architecture Support#254
onedr0p merged 18 commits intohome-operations:mainfrom
dapperdivers:posterizarr

Conversation

@dapperdivers
Copy link
Contributor

@dapperdivers dapperdivers commented Mar 25, 2025

I WOULD LOVE some honest feedback here even if you hate it. This is my best implementation of what yall have been doing in here to get away from running this bad boy with s6-setuidgid and root.

This PR adds a new container for Posterizarr, an automated poster generation tool for Plex/Jellyfin/Emby media libraries. The implementation includes full support for both AMD64 and ARM64 architectures.

Changes

  1. Initial Container Implementation
    Added Dockerfile based on Ubuntu 24.04
    Implemented entrypoint.sh script with proper error handling and test mode support
    Added comprehensive tests to verify container functionality
    Configured metadata for version tracking (currently v1.9.34)

  2. Multi-Architecture Support

  • ARM64 support using Microsoft's recommended binary archive installation method
  • Added configurable PowerShell version as a build argument (currently 7.5.0) ? dunnno if this is right
  1. Testing
    Add environment variables for test mode to all test cases - this runs as a fire and forget not a container

Technical Details

The container builds ImageMagick from source to ensure the latest version is available. PowerShell is installed using architecture-specific methods

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

Added Dockerfile based on Ubuntu 24.04

Did you look at trying to implement this with an Alpine base image instead? We usually try out best to stick with that as a base but I understand if maybe there's some musl issues with this app?

The container builds ImageMagick from source to ensure the latest version is available. PowerShell is installed using architecture-specific methods

I would advise against compiling from source unless there was no other option, in the Alpine repos it looks like 3.21 has 7.1.1.

If you must use Ubuntu, 25.04 has 7.1.1

@dapperdivers
Copy link
Contributor Author

dapperdivers commented Mar 25, 2025

The app does a weird check where it looks for the latest version and tries to download a copy of it locally. Building from source allows us to skip that check as its always the latest version

I didn't like that. Seemed weird that the script itself could download executable and run it.

  • I can give alpine a shot. the base image was built on ubuntu, and the plex one in this repo was ubuntu so I figured goodish on that one

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

The app does a weird check where it looks for the latest version and tries to download a copy of it locally. Building from source allows us to skip that check as its always the latest version

Seems like that concern should be addressed upstream 😬

I can give alpine a shot. the base image was built on ubuntu, and the plex one in this repo was ubuntu so I figured goodish on that one

We tried to get Plex on alpine but it didn't like musl for arm64 containers.

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

https://github.com/fscorrupt/Posterizarr/blob/0e3fc6880839ea1eb5d5e833e1efc99cd292af3f/Posterizarr.ps1#L3791-L3801

Looks like it only downloads imagemagick if OSType is not Docker (whatever that is, an env var?)

@dapperdivers
Copy link
Contributor Author

The app does a weird check where it looks for the latest version and tries to download a copy of it locally. Building from source allows us to skip that check as its always the latest version

Seems like that concern should be addressed upstream 😬

I'll see what I can do, but I don't have a ton of confidence there. I'm learning a bit on this one. Are there any best practices that would block that kind of behavior I can add to the dockerfile/ entrypoint?

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

Do you have a link to their Dockerfile / Docker build files? I cannot find it. That would really help unravel this whole thing.

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

I also see Powershell in the alpine pkgs, https://pkgs.alpinelinux.org/package/v3.21/community/x86_64/powershell

@dapperdivers
Copy link
Contributor Author

Do you have a link to their Dockerfile / Docker build files? I cannot find it. That would really help unravel this whole thing.

Not likely to get it. This is why I went down this path >>
fscorrupt/posterizarr#179 (comment)

@dapperdivers
Copy link
Contributor Author

fscorrupt/Posterizarr@0e3fc68/Posterizarr.ps1#L3791-L3801

Looks like it only downloads imagemagick if OSType is not Docker (whatever that is, an env var?)

fscorrupt/Posterizarr@0e3fc68/Posterizarr.ps1#L81

I think this.
POWERSHELL_DISTRIBUTION_CHANNEL

@onedr0p
Copy link
Contributor

onedr0p commented Mar 25, 2025

Do you have a link to their Dockerfile / Docker build files? I cannot find it. That would really help unravel this whole thing.

Not likely to get it. This is why I went down this path >> fscorrupt/Posterizarr#179 (comment)

Ermmm... well that's a thing. What a weird stance.

@onedr0p onedr0p marked this pull request as draft March 26, 2025 00:20
@onedr0p
Copy link
Contributor

onedr0p commented Mar 26, 2025

I've converted this to a draft, feel free to update when you have time.

@dapperdivers
Copy link
Contributor Author

I've converted this to a draft, feel free to update when you have time.

Will do! Testing the build with alpine. 🤞 that goes well

@onedr0p
Copy link
Contributor

onedr0p commented Mar 26, 2025

@dapperdivers I would also try to slim down the entrypoint.sh, or even remove it? Can't you just set the powershell script in the containers ENTRYPOINT ? It does feel a bit weird to have bash be a wrapper to a powershell script 😉

@dapperdivers dapperdivers marked this pull request as ready for review March 26, 2025 02:41
@dapperdivers dapperdivers requested a review from onedr0p March 26, 2025 04:46
@dapperdivers
Copy link
Contributor Author

Also.... WOW from where I was this morning to now is wild. this image was close to 3 gigs and good god complex.

@dapperdivers
Copy link
Contributor Author

dapperdivers commented Mar 27, 2025

https://github.com/DapperDivers/dapper-cluster/tree/main/kubernetes/apps/media/posterizarr/app

Well 🤷 I'm good to merge this thing if you are!

I had to get a little weird with the secrets/ config, and I've stuck the "running" file fix in here.
should I move the "font copy" here too? or leave it in the dockerimage? never really sure where to draw that line

https://github.com/DapperDivers/dapper-cluster/blob/main/kubernetes/apps/media/posterizarr/app/config/init-config.sh

@buroa
Copy link
Collaborator

buroa commented Mar 27, 2025

Great job, this looks so much better than the first implementation. I have been busy this week but it looks like @onedr0p got you on the right track!

@fscorrupt
Copy link

fscorrupt commented Mar 27, 2025

Okay, so thanks for all the ideas and work on this, @dapperdivers . I had a look at your approach and adjusted my dev container to reflect your Dockerfile. I also added the Start.ps1 part as it is required for Tautulli's recent function, and I adjusted the Dockerfile accordingly. It should work on your side now with my dev container (also a non-root container now).

Repo: https://github.com/fscorrupt/docker-posterizarr-dev

Image: ghcr.io/fscorrupt/docker-posterizarr-dev:latest

@onedr0p
Copy link
Contributor

onedr0p commented Mar 27, 2025

@fscorrupt you should really look to consolidate your repos into one, put the container bits into to your main repo to make things hella easier, these could then be pulled in from the local filesystem and you can easily version the container image the same as the script/application.

@onedr0p
Copy link
Contributor

onedr0p commented Mar 27, 2025

@dapperdivers I'm going to suggest if possible to work with @fscorrupt on improvements to his container. We can merge this if you still feel it's useful but upstream looks to be trying to follow along with the improvements you've made.

@fscorrupt
Copy link

fscorrupt commented Mar 27, 2025

@fscorrupt you should really look to consolidate your repos into one, put the container bits into to your main repo to make things hella easier, these could then be pulled in from the local filesystem and you can easily version the container image the same as the script/application.

@onedr0p I made it that way to be able to update the application separately from the container, as I always used the container just as a prerequisite to run the script. If I packed everything into the image, I would always have to rebuild it for script changes. Now, I only need to restart the container instead of rebuilding it.

But ive added that part (main posterizarr repo) to the dev repo and edited the dockerfile - so we can play with it.

@onedr0p
Copy link
Contributor

onedr0p commented Mar 27, 2025

That issue can be solved by running it locally by just building it.. e.g. by have a separate docker-compose.dev.yaml that builds the container and runs it.

services:
  app:
    build: .
...

@fscorrupt
Copy link

fscorrupt commented Mar 27, 2025

Okay, yeah, maybe @dapperdivers can take a look at the workflows and everything in the dev repo. It should now be in a state where all required files from Posterizarr are present. I'm looking forward to a PR! :D

@dapperdivers
Copy link
Contributor Author

dapperdivers commented Mar 27, 2025

fscorrupt/posterizarr#227

Alrighty, I've pulled the PR above together to address some of the original concerns. I'd like to propose we merge this for the time being, and once things get buttoned up upstream we can remove this wrapper!

@onedr0p
Copy link
Contributor

onedr0p commented Mar 27, 2025

I'll go ahead and merge this but please notify us if upstream can ever take it over. Thanks!

@onedr0p onedr0p merged commit 1a771f9 into home-operations:main Mar 27, 2025
8 checks passed
lenaxia pushed a commit to lenaxia/containers that referenced this pull request Sep 11, 2025
…tions#254)

Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants