Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Latest commit

 

History

History
51 lines (36 loc) · 1.15 KB

File metadata and controls

51 lines (36 loc) · 1.15 KB

WP-CLI on Alpine Linux

WP-CLI built from Composer build on top of Alpine Linux.

Usage

Below are some examples of how you can use wp-cli.

Bash alias

Create a bash alias i.e.:

function wp() {
    docker run -it --rm \
        -v $(pwd):/mnt \
        cloudposse/wp-cli:latest ${@:1}
}

Create a Wordpress project

$ mkdir wp-test && cd wp-test
$ wp core download
$ wp core config --dbhost=db --dbname=wptest --dbuser=root --dbpass=root
$ wp core install \
    --url=http://wp-test \
    --title="Awesome website" \
    --admin_user=admin --admin_password=admin --admin_email admin@example.com

Perform Database Operations

Import/export database:

$ cd /path/to/wordpress/project
$ wp db import /mnt/dump.sql

NOTE: The --path argument is relative to paths inside of the container. Bind mount volumes as necessary.

Credits

This image is built from bits and pieces of other Dockerfiles.

Thanks to contributions by the following people: