Wordpress: Connect wp-cli to LEMP stack

Created on 19 Jan 2019  路  2Comments  路  Source: docker-library/wordpress

How do you connect wp-cli to a LEMP stack?

question

Most helpful comment

@robots4life it's not even hard to install wp-cli. What're you doing wrong is including wordpress:cli in your docker-compose when it's supposed to be ran independently via docker run.

docker run -it --rm \
    --volumes-from wordpress_php_container \
    --network container:wordpress_php_container \
    wordpress:cli user list

This would create the wp-cli container, execute wp-cli commands to your wordpress_php_container, then self destruct.

All 2 comments

https://github.com/docker-library/docs/tree/master/wordpress#wordpresscli

This image variant does not contain WordPress itself, but instead contains WP-CLI.

For better help with your setup you could ask the Docker Community Forums, the Docker Community Slack, or Stack Overflow. As these repositories are for issues with the image and not necessarily for questions of usability

@robots4life it's not even hard to install wp-cli. What're you doing wrong is including wordpress:cli in your docker-compose when it's supposed to be ran independently via docker run.

docker run -it --rm \
    --volumes-from wordpress_php_container \
    --network container:wordpress_php_container \
    wordpress:cli user list

This would create the wp-cli container, execute wp-cli commands to your wordpress_php_container, then self destruct.

Was this page helpful?
0 / 5 - 0 ratings