Skip to content

Instantly share code, notes, and snippets.

@tatemz
Last active December 18, 2020 06:59
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatemz/fd745b4e48629255b4a158fa2c0667df to your computer and use it in GitHub Desktop.
Save tatemz/fd745b4e48629255b4a158fa2c0667df to your computer and use it in GitHub Desktop.
A quick way to use one-off wp-cli commands with Docker. See Part 1: https://gist.github.com/tatemz/504383c921aa5898c49b82d4ee181362
#!/bin/bash
cd wordpress-site
cat >> docker-compose.yml <<EOL
my-wpcli:
image: tatemz/wp-cli
volumes_from:
- my-wp
links:
- my-wpdb:mysql
entrypoint: wp
command: "--info"
EOL
docker-compose up -d
alias wp="docker-compose run --rm my-wpcli"
wp --info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment