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

Custom s6 services dependencies no longer works #479

Open
LorenzoRogai opened this issue Oct 22, 2024 · 9 comments
Open

Custom s6 services dependencies no longer works #479

LorenzoRogai opened this issue Oct 22, 2024 · 9 comments
Assignees
Labels
🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member.

Comments

@LorenzoRogai
Copy link

LorenzoRogai commented Oct 22, 2024

Steps To Reproduce

Image: 8.3-fpm-nginx-alpine

In the latest version i can no longer define custom s6 services depending on like 50-laravel-automations - it was working fine with the 2 months ago image

This is the copy definition inside the Dockerfile

# Copy s6 additional services
COPY --chmod=755 ./s6-overlay/s6-rc.d/ /etc/s6-overlay/s6-rc.d/

It seems that the folder "/etc/s6-overlay/s6-rc.d" no longer contains 50-laravel-automations etc files so when the container starts S6 gives a "50-laravel-automations dependency not found" error

How can i achieve the same flow on the latest build?

Outcome

What did you expect?

What happened instead?

Affected Docker Images

serversideup/php:8.3-fpm-nginx-alpine

Anything else?

No response

@LorenzoRogai LorenzoRogai added the 🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member. label Oct 22, 2024
@opheus2
Copy link

opheus2 commented Oct 28, 2024

I'm having similar issues this is the error I get on startuo

image

@jaydrogers
Copy link
Member

Crap. I never thought of people relying on the S6 dependency for their own scripts.

What changed

In this PR, we removed the complexity of the S6 overlay process and went complete with a "entrypoint.d" process. This means we did not need the s6-init script that we had before: https://github.com/serversideup/docker-php/pull/437/files#diff-504915b54cc60b1169bd08592a14a22dc540b50dae0f6c75ac9902a37cc2bcca

To update your scripts

Everything should work if you put it in entrypoint.d without the S6 hacks that we had to place in before: https://serversideup.net/open-source/docker-php/docs/customizing-the-image/adding-your-own-start-up-scripts

My question

Does this satisfy both of your needs? Or is your use case highly specific where it needs to be managed by S6?

@LorenzoRogai
Copy link
Author

@jaydrogers I don’t think that it will work. I tried it initially, but since I need to start a long-running application (like amqproxy or pgbouncer), it doesn’t function properly with entrypoint.d scripts. It needs to be set up as an s6 service, similar to how nginx is configured

@dragonfly4
Copy link

Same issues after upgrading to the latest release.

[NOTICE]: S6 is not initialized. Skipping web server configuration and running custom command.

Is there an easy way to load S6 even when a command is specified?

@jaydrogers
Copy link
Member

Can you share your use case?

Right now, if you pass the CMD of composer install to the container, it will just run composer install.

Before it would run composer install and start NGINX with S6 Overlay (which is inefficient and lead to a weird UX).

@jaydrogers
Copy link
Member

@jaydrogers I don’t think that it will work. I tried it initially, but since I need to start a long-running application (like amqproxy or pgbouncer), it doesn’t function properly with entrypoint.d scripts. It needs to be set up as an s6 service, similar to how nginx is configured

@LorenzoRogai: Have you attempted to write your own S6 service and add that to your image? https://github.com/just-containers/s6-overlay?tab=readme-ov-file#writing-a-service-script

Then we don't need to rely on this old script which was kind of a hack to take entrypoint.d files and put them in the S6 format https://github.com/serversideup/docker-php/blob/20ecec1d9668088200d3ef1cc9b80186935ccde2/src/s6/usr/local/bin/docker-php-serversideup-s6-init

@jaydrogers
Copy link
Member

I added documentation on why you don't want to use entrypoint services to run long-running services: https://serversideup.net/open-source/docker-php/docs/customizing-the-image/adding-your-own-start-up-scripts#long-running-services

I am closing this for now, but please comment below if you have any further questions 👍

@LorenzoRogai
Copy link
Author

LorenzoRogai commented Nov 7, 2024

@jaydrogers If I understand correctly, you were previously using s6 to launch "oneshot" commands, but you've since removed this, which is fine. As I mentioned in the original issue, I've already created a custom s6 service. However, it seems that the custom service can no longer find the 50-laravel-automation dependency because 50-laravel-automation is no longer an s6 "oneshot" command.

How can I maintain the same startup order now that 50-laravel-automation is no longer part of s6?

@jaydrogers jaydrogers reopened this Nov 13, 2024
@jaydrogers
Copy link
Member

Just letting you know that I am circling back to this. I think I am going to bring this script back.

Will keep you posted once I have more time to look at this 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member.
Projects
None yet
Development

No branches or pull requests

4 participants