Add wp-cli and abra wp command #2

Closed
opened 2020-09-13 16:29:51 +00:00 by 3wordchant · 1 comment
Owner

Looks like wp-cli may or may not be added to upstream image eventually: https://github.com/docker-library/wordpress/issues/283

In the mean-time, it's relatively easy to use another container:
https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79

But we'd have to expose /var/www/html as a volume :(

Looks like `wp-cli` may or may not be added to upstream image eventually: https://github.com/docker-library/wordpress/issues/283 In the mean-time, it's relatively easy to use another container: https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79 But we'd have to expose `/var/www/html` as a volume :(
3wordchant changed title from Add `abra wp` command to Add wp-cli and `abra wp` command 2020-09-24 14:29:39 +00:00
Author
Owner

Having gritted our teeth and plumped for a /var/www/html volume, the magic recipe for running wp commands is:

export CONTAINER_ID=$(DOCKER_CONTEXT=swarm.example.com docker container ls -f 'Name=example_com_app' --format '{{ .ID }}'); DOCKER_CONTEXT=swarm.example.com docker run -it --volumes-from "$CONTAINER_ID" --network "container:$CONTAINER_ID" wordpress:cli wp search-replace --path=/var/www/html https://old.domain https://new.domain

Wow, That's A Big Command-Line! 😸

Having gritted our teeth and plumped for a `/var/www/html` volume, the magic recipe for running `wp` commands is: ```export CONTAINER_ID=$(DOCKER_CONTEXT=swarm.example.com docker container ls -f 'Name=example_com_app' --format '{{ .ID }}'); DOCKER_CONTEXT=swarm.example.com docker run -it --volumes-from "$CONTAINER_ID" --network "container:$CONTAINER_ID" wordpress:cli wp search-replace --path=/var/www/html https://old.domain https://new.domain``` Wow, That's A Big Command-Line! 😸
This repo is archived. You cannot comment on issues.
No Label
No Milestone
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/wordpress#2
No description provided.