From 507edb7beef21954da15ddb09f5e21e2e683ae21 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 4 Oct 2017 12:53:35 -0700 Subject: [PATCH] Add a simple description of the WP-CLI variants --- wordpress/variant-cli.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 wordpress/variant-cli.md diff --git a/wordpress/variant-cli.md b/wordpress/variant-cli.md new file mode 100644 index 000000000000..6e4d2933b2ba --- /dev/null +++ b/wordpress/variant-cli.md @@ -0,0 +1,14 @@ +## `%%IMAGE%%:cli` + +This image variant does not contain WordPress itself, but instead contains [WP-CLI](https://wp-cli.org). + +The simplest way to use it with an existing WordPress container would be something similar to the following: + +```console +$ docker run -it --rm \ + --volumes-from some-wordpress \ + --network container:some-wordpress \ + wordpress:cli user list +``` + +Generally speaking, for WP-CLI to interact with a WordPress install, it needs access to the on-disk files of the WordPress install, and access to the database (and the easiest way to accomplish that such that `wp-config.php` does not require changes is to simply join the networking context of the existing and presumably working WordPress container, but there are many other ways to accomplish that which will be left as an exercise for the reader).