Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker mod s6-rc.d not in final image #753

Closed
ReenigneArcher opened this issue Aug 29, 2023 · 13 comments
Closed

docker mod s6-rc.d not in final image #753

ReenigneArcher opened this issue Aug 29, 2023 · 13 comments

Comments

@ReenigneArcher
Copy link
Contributor

I am the dev of a jellyfin mod. A user reported an issue that my jellyfin plugin is causing a crash due to incorrect permissions on the plugin files. LizardByte/Themerr-jellyfin#68

I attempted to correct this by using the s6 init methodology; however the issue seems to persist. It's possible that I missed something, but I cannot determine what the issue might be.

s6-rc.d directory

I really just have a single run file, and the up file points to that file.

I have chmod +xed the run file -> https://github.com/LizardByte/Themerr-jellyfin/blob/f9d11125e9bf6c1a4e54ebeb3c124fdc9b532e42/Dockerfile#L88

And I believe everything is in the correct location. Copied from ./dockermod_root to / at the end of the image in the final stage. -> https://github.com/LizardByte/Themerr-jellyfin/blob/f9d11125e9bf6c1a4e54ebeb3c124fdc9b532e42/Dockerfile#L101

But it appears these files are not in the jellyfin image after creating the image with the mod argument.
image

Could someone give a quick review and see where I might have went wrong?

Additionally, is there anyway to use a local image for the DOCKER_MODS variable? As far as I am seeing it appears to ignore local images.

@ReenigneArcher
Copy link
Contributor Author

As suggested by the readme, I have inspected my mod image with dive, which does show the files in /etc ... so not sure whey they are not appearing in the final image.

image

@aptalca
Copy link
Member

aptalca commented Aug 29, 2023

Your final image has two layers (2 copy directives). The mod has to have only 1 layer.

In our mods, we copy all necessary files/folders into the same folder, and then in the final image do a single copy directives to move all files and folders to the final image, resulting in a single layer.

The reason is because we treat the mods as free storage in the registries. We download and extract the single tarball (each layer is a separate tarball) during container start.

See here for example: https://github.com/linuxserver/docker-mods/blob/universal-docker-in-docker/Dockerfile#L71

We collect everything in /root-layer in the build stage. And then copy /root-layer to / as a single layer in the final image.

@aptalca
Copy link
Member

aptalca commented Aug 29, 2023

With regards to local images, the answer is no. Our mod logic just downloads the tarball from the registry.

For testing, you can either build local and push to your docker or ghcr account, or you can utilize our mod builder github workflow, which builds and pushes PRs to your registries along with a PR comment with the image link:
https://github.com/linuxserver/docker-mods/blob/universal-docker-in-docker/.github/workflows/BuildImage.yml

You just need to set the github repo to your own and set the 4 secrets with your values.

@ReenigneArcher
Copy link
Contributor Author

Perfect, thanks for the fast response. I'll adjust the image so there is only one layer in the final stage of the build. Thank you!

@ReenigneArcher
Copy link
Contributor Author

Okay, now the layer is there, but I am getting an error about the type file.

2023-08-29 14:51:26 [mod-init] Attempting to run Docker Modification Logic
2023-08-29 14:51:26 [mod-init] Adding lizardbyte/themerr-jellyfin:nightly to container
2023-08-29 14:51:27 [mod-init] Downloading lizardbyte/themerr-jellyfin:nightly from registry-1.docker.io
2023-08-29 14:51:28 [mod-init] Installing lizardbyte/themerr-jellyfin:nightly
2023-08-29 14:51:28 [mod-init] lizardbyte/themerr-jellyfin:nightly applied to container
2023-08-29 14:51:28 s6-rc-compile: fatal: invalid /etc/s6-overlay/s6-rc.d/init-mod-jellyfin-themerr-config/type: must be oneshot, longrun, or bundle

I copied this file from another mod, and it is a oneshot

https://github.com/LizardByte/Themerr-jellyfin/blob/8819383ce26500bb700beb408a16012c2988df36/dockermod_root/etc/s6-overlay/s6-rc.d/init-mod-jellyfin-themerr-config/type#L1

@Roxedus
Copy link
Member

Roxedus commented Aug 29, 2023

The type (and the other S6 files) are saved with a encoding of UTF8 with bom, changing it to UTF8 does the trick.

@ReenigneArcher
Copy link
Contributor Author

@Roxedus do you have an example of how I am supposed to fix that?

@Roxedus
Copy link
Member

Roxedus commented Aug 29, 2023

In ie VSCode you press the UTF8 with bom text on the bottom bar, and select the save with encoding when pressing the text.

@ReenigneArcher
Copy link
Contributor Author

@Roxedus okay, thanks I found it in Rider... Never faced an issue like this before, ha... So all the s6 init files should not have BOM encoding? Including the run file?

@Roxedus
Copy link
Member

Roxedus commented Aug 29, 2023

personally I usually stick to utf8 without bom wherever I can

@ReenigneArcher
Copy link
Contributor Author

"hopefully" the final issue. Again, this is the Jellyfin image.

2023-08-29 17:34:40 System.UnauthorizedAccessException: Access to the path '/config/data/plugins/configurations' is denied.

I'm thinking the permissions on this directory should be handled by the main image, as multiple mods could be applied. I've submitted a PR here -> linuxserver/docker-jellyfin#214

@LinuxServer-CI
Copy link

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

4 participants