Public | Automated Build

Last pushed: a month ago
Short Description
WP-CLI on Alpine Linux
Full Description

WP-CLI on Alpine Linux

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

Alias

Bash alias

Minimal:

wp() {
    docker run -it --rm \
        -v $(pwd):/mnt \
        soifou/wpcli-alpine:latest ${@:1}
}

Bells and whistles:

wp() {
    tty=
    tty -s && tty=--tty
    docker run \
        $tty \
        --interactive \
        --rm \
        -v $(pwd):/mnt \
        -u `id -u`:`id -g` \
        --net=my-network \
        soifou/wpcli-alpine: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@admin.com

Database operations

Since the --path point inside the container, your dump must be available inside.

$ cd /path/to/wordpress/project
$ wp db dump /mnt/dump.sql
$ wp db import /mnt/dump.sql
Docker Pull Command
Owner
soifou
Source Repository