-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hook in to specific point in entrypoint script #147
Comments
It could work currently, if you name your script "apache2-something" and run the container with |
True, hadn't thought of that. But wouldn't that mess up later calls to those services, for whatever reason? |
I'm not sure what "later calls" you are referring to. As long as your script is idempotent, then a |
Thanks for the info. |
As far as a place to hook scripts, this was previously proposed in #124. I am still unconvinced of the usefulness. Any required themes (or plugins) could easily be placed in |
Some good points were made in that issue, in favor of additional script.
|
This is a really important issue. For anyone who wants to create a deployable image with this + db backup (anywhere), it is not practical to externally download all plugins etc. and then mount them. |
I should clarify, I'm already extending the image and the only step I'm having difficulty with, is a sensible way to run my own wp-cli commands as part of the initial setup. I guess I need to just inject my script into the process, but it'd be great to have some advice on this. |
@SamMorrowDrums I'm still in favor of just chaining your own script with the current entrypoint by taking advantage of line 4 that matches any executable that starts with $ # make sure my script ends with exec apache2-foreground
$ # put the script in the PATH to make it run without a full path to the file
$ docker run -d -v /path/to/my-script.sh:/usr/local/bin/apache2-special.sh ... wordpress "apache2-special.sh"` |
@yosifkit I do see where you are coming from - a very WP specific issue though, is that as the Surely it's not a lot to ask that an optional It would make a huge difference to usability, and while I can see the principled point about the parent image - all I want is to be able to add a manifest of plugins that will be installed and enabled on the image first start. Wordpress is very hard to use in a docker automatic deployment workflow without being able to do this. I have tried other means of obtaining plugins, but they are not really right. |
The above might have been a bit dense. I'm just trying to say that some kind of event where Wordpress has been set up - now hand off to the user of this image (just once, for init), would be incredibly useful. There must be a way to handle that sensibly, in a way that is acceptable to all parties. |
@SamMorrowDrums interesting idea -- you're thinking something like this added to if (file_exists('/some-well-known-docker-specific/path.php')) {
require '/some-well-known-docker-specific/path.php';
} |
(probably actually |
That sounds like an excellent avenue to pursue! Would really be powerful to
configure in that way.
…On Sat, 10 Dec 2016, 18:30 Tianon Gravi, ***@***.***> wrote:
(probably actually require_once to ensure that if WordPress decides to
load wp-config.php more than once, we only run it once -- not sure what
WordPress behavior is WRT loading wp-config.php, but IIRC poorly-behaved
plugins used to do really hacky things in that regard 😇)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#147 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AElqXoTBTcR8CGsDAl0G4Or9SUj9UoL1ks5rGu_ggaJpZM4IgbZD>
.
|
Any update? |
This should be possible with #142! 🎉 |
Closing given that this is possible with the implementation of #142! 👍 🎉 |
I need to do some other stuff in the container before the
php-fpm
is started, but afterentrypoint.sh
file provisions wordpress.In between those two steps, I want to add some plugins (via wp-cli).
So it would be nice if we could hook in to the setup process.
Just before
exec "$@"
we could have code that checks if there is a script in predetermined location,and if there is, it executes it.
The text was updated successfully, but these errors were encountered: