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-CLI commands do not work in dev container #1440

Open
pavelevap opened this issue May 3, 2019 · 1 comment
Open

WP-CLI commands do not work in dev container #1440

pavelevap opened this issue May 3, 2019 · 1 comment
Labels
bug Bugs. For major ones, add "major". scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc.
Milestone

Comments

@pavelevap
Copy link
Collaborator

I tried following:

  • docker exec -it vpdev_wordpress_1 wp vp apply-changes
  • docker-compose exec wordpress wp vp apply-changes

Everytime it ends with error:
Error: Maintenance mode couldn't be switched. Details: www-data is not in the sudoers file. This incident will be reported.

@JanVoracek suggested that problem is probably with this code:

echo 'sudo -u www-data /bin/wp-cli.phar "$@"'; \

I am not sure if we can simply remove it.

WP-CLI instalation should be reviewed as a whole, see related issue #1412.

@pavelevap pavelevap added this to the 4.0 milestone May 3, 2019
@pavelevap pavelevap added bug Bugs. For major ones, add "major". scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. labels May 3, 2019
@efuturetoday
Copy link

I had the same problem for my docker environment.
Just adding this to your Dockerfile should fix it.
Make sure that you have sudo installed.

RUN sudo adduser www-data sudo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs. For major ones, add "major". scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc.
Projects
None yet
Development

No branches or pull requests

2 participants