Skip to content

Fix wp-env mu-plugins Docker mount failure#587

Open
obenland wants to merge 1 commit intoWordPress:trunkfrom
obenland:fix/wp-env-mu-plugins-mount
Open

Fix wp-env mu-plugins Docker mount failure#587
obenland wants to merge 1 commit intoWordPress:trunkfrom
obenland:fix/wp-env-mu-plugins-mount

Conversation

@obenland
Copy link
Copy Markdown
Member

@obenland obenland commented Apr 2, 2026

Summary

  • Docker failed to start the plugin-directory wp-env because individual file mounts (wporg-query-filter.php, etc.) overlaid on top of a directory mount resolved outside the container rootfs
  • Switches to a directory-first approach: map wp-content/mu-plugins to ./mocks/mu-plugins/, then overlay pub/ and wporg-mu-plugins/ on top — matching the pattern used in wporg-two-factor
  • Consolidates all mock mu-plugin files into environments/mocks/mu-plugins/, reducing 6 mapping entries to 3

Test plan

  • Run npm run plugins:env start — should start without Docker mount errors
  • Verify all mu-plugins load: npx wp-env run cli -- wp plugin list --status=must-use
  • Verify plugin import works: npx wp-env run cli -- wp eval-file wp-content/env-bin/import-plugins.php

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 2, 2026 16:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ and wporg-mu-plugins/.
  • Consolidate local mock MU-plugin files under environments/mocks/mu-plugins/.
  • Simplify .wp-env.json MU-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.

@obenland
Copy link
Copy Markdown
Member Author

obenland commented Apr 2, 2026

@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 /run/host_virtiofs/ which lands outside the container's overlay rootfs. Directory-on-directory mounts don't have this problem, which is why the mocks folder approach works for me.

Do you use a different setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants