Fix wp-env mu-plugins Docker mount failure#587
Fix wp-env mu-plugins Docker mount failure#587obenland wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Docker failed to create mountpoints for individual files overlaid on top of a directory mount, because the target paths resolved outside the container rootfs. Switch to mapping the entire mu-plugins directory to a local mocks folder first, then overlaying pub/ and wporg-mu-plugins/ on top — matching the pattern used in wporg-two-factor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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 was a problem hiding this comment.
Pull request overview
This PR fixes the plugin-directory wp-env Docker startup failure by restructuring MU-plugin volume mappings to avoid problematic nested individual-file mounts.
Changes:
- Switch MU-plugins mapping to mount a local directory first, then overlay
pub/andwporg-mu-plugins/. - Consolidate local mock MU-plugin files under
environments/mocks/mu-plugins/. - Simplify
.wp-env.jsonMU-plugin mappings from multiple file mounts to three directory mounts.
Reviewed changes
Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| environments/plugin-directory/.wp-env.json | Reworks MU-plugin mappings to a directory-first overlay approach to prevent Docker mount failures. |
| environments/mocks/mu-plugins/wporg-query-filter.php | Adds a local-only query short-circuit MU-plugin to avoid queries to production-only tables. |
| environments/mocks/mu-plugins/wporg-dev-login.php | Adds a local-only one-click login helper on the login screen. |
| environments/mocks/mu-plugins/mu-plugins-loader.php | Adds a loader MU-plugin to bootstrap MU-plugins from pub/ and wporg-mu-plugins/. |
| environments/mocks/mu-plugins/mu-plugin-local-reminders.php | Adds a local-only admin notice to guide importing approved plugins that have no content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@dd32 I wanted to propose this update again, the way it's setup in trunk currently just doesn't work on my machine. I'm using Docker Desktop on MacOS which uses VirtioFS and when it tries to create file mountpoints inside an already-mounted directory, the paths resolve through Do you use a different setup? |
|
@obenland I'm happy to merge this, but I'd like to understand why it's actually needed.. as AFAIK we were running the same environment :) I'm running with VirtioFS as well, and Hrrrmm... I was running Docker Desktop 4.40, i've updated to 4.67 and it's broken in a similar way to what you describe.. although this PR is also broken :/ Under 4.67 it's using Okay, I'm running into a regression in 4.67.. docker/desktop-feedback#279 docker/desktop-feedback#264 ...Rolled back to 4.66, and trunk still works for me, but so does this PR. Anyway, claude has this to say:
Let's just merge it. |
According to Claude, trunk doesn't work under 4.66;
That sounds like the issue you were running into that lead to this, which I now see looks like it's landed in Docker Desktop 4.66, it's just that in 4.67 it was broken even further :) Which version are you running? |
| "wp-content/mu-plugins/mu-plugins-loader.php": "./mocks/mu-plugins-loader.php", | ||
| "wp-content/mu-plugins/wporg-query-filter.php": "./mocks/wporg-query-filter.php", | ||
| "wp-content/mu-plugins/wporg-dev-login.php": "./mocks/wporg-dev-login.php", | ||
| "wp-content/mu-plugins/wporg-plugins-local-reminders.php": "./plugin-directory/mu-plugin-local-reminders.php", |
There was a problem hiding this comment.
I'm not a fan of moving mu-plugin-local-reminders.php into the generic mu-plugins folder you've made, I'd rather that be contained to the plugin directory.
I think we'd then have:
- mu-plugins/
- mu-plugins/pub/
- mu-plugins/wporg-mu-plugins/
- mu-plugins/plugin-directory/
Or maybe the local-reminders.php should be instead just added to the general plugin-directory codebase locked behind a 'local' === wp_get_development_type() branch.. yeah that's probably the best option..
I was running 4.66. Looks like this bug might be fixed with 4.68 🤞 |
Summary
wporg-query-filter.php, etc.) overlaid on top of a directory mount resolved outside the container rootfswp-content/mu-pluginsto./mocks/mu-plugins/, then overlaypub/andwporg-mu-plugins/on top — matching the pattern used in wporg-two-factorenvironments/mocks/mu-plugins/, reducing 6 mapping entries to 3Test plan
npm run plugins:env start— should start without Docker mount errorsnpx wp-env run cli -- wp plugin list --status=must-usenpx wp-env run cli -- wp eval-file wp-content/env-bin/import-plugins.php🤖 Generated with Claude Code