Skip to content

wp-cli upgrades not working #81

Description

@joemaller

The README says to run:

The base image provides a specific WordPress version, but running sites can upgrade via the wp-admin dashboard or wp-cli, including pre-release versions:

wp core update --version=7.1-RC2

Versions can be rolled back by removing the Docker *_wp volume.

But that fails with permissions errors because /var/www/html is owned by root.

Workaround command:

docker compose exec -u root wordpress wp core update --allow-root --version=7.1-RC2 

Possible fixes:

  • Run all wp-cli commands as root
  • Create a second wp-cli:root script that runs docker compose with -u root
  • Change ownership of the web directory and/or WordPress core files so the wp user can update. This would probably happen in the entrypoint script.

I like the last one, but needs to be careful not to take over wp-content directories which are mounted user.

chown wp:wp /var/www/html
chmod 775 /var/www/html

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions