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

wp-env: Fix chown cannot access 'wp-config.php' #30053

Merged
merged 3 commits into from
Apr 9, 2021

Conversation

ribaricplusplus
Copy link
Member

@ribaricplusplus ribaricplusplus commented Mar 20, 2021

Description

IMPORTANT: Do not merge this until docker-library/wordpress#587 gets pushed to Docker Hub. Update: The change has been pushed to Docker Hub and this PR is safe to merge.

This PR fixes #29814. We used to manually run chown on wp-config.php because Docker Hub Wordpress image would create it with root being the owner, which means we can't access wp-config.php with wp cli and that caused problems. The problem with this manual solution was that there was a race condition: After containers start, the files are not actually ready, and if we run chown before files are copied, the issue #29814 happens.

Since the permission problem is now solved at the root, in the Docker Hub image in the aforementioned PR, there's no longer any need for manually doing chown, so this PR removes that.

How is this tested

EDIT: Now that the Docker Hub image has been updated, this PR can be tested by simply getting it locally and trying wp-env start

I manually built the WordPress image from the aforementioned PR docker-library/wordpress#587 and used this PR for wp-env. If you want to test the same way, it will be necessary to change FROM in the Dockerfile to the image that you manually build, that is here:

return `FROM ${ image }

@ribaricplusplus ribaricplusplus changed the title wp-env: Fix chown: cannot access 'wp-config.php' wp-env: Fix chown cannot access 'wp-config.php' Mar 20, 2021
@noahtallen
Copy link
Member

Some related issues this might solve (or open a path towards solving): #22515, #28201, #29929

@ribaricplusplus
Copy link
Member Author

ribaricplusplus commented Mar 23, 2021

The needed change to Docker Hub wordpress image has been pushed: docker-library/official-images#9833

This PR can now be merged (as far as I'm concerned).

Copy link
Member

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

I did a lot of testing on this, and everything is working very well (both with and without specifying core sources). Thanks for investigating this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env: chown: cannot access 'wp-config.php' when running wp-env start
2 participants