-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Don't run WP-CLI commands as root #9329
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
Don't run WP-CLI commands as root #9329
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
There is an E2E test failures when I run This is also happening in GHA:
But this is also happening in |
|
I am able to successfully add constants: |
Yeah it's been there a while now. We've got https://core.trac.wordpress.org/ticket/63024 but no movement so far. |
|
Committed in r60518. |

The WP-CLI container runs as root. Its entrypoint script uses sudo to run commands as the
wp_phpuser, but the entrypoint is bypassed when you usedocker compose exec. This is why the--allow-rootflag is needed in thedocker compose execcommands which are used since r60308.We can't add
user: wp_phpto docker-compose.yml because when the container initially starts the entrypoint script still runs butwp_phpisn't in the sudoers list and therefore terminates. What we can do is rundocker compose execwith the--user wp_phpflag and everything is rosey.Trac ticket: https://core.trac.wordpress.org/ticket/63167
Trac ticket: https://core.trac.wordpress.org/ticket/63564