WP-CLI baked from PHP Composer build on top of Alpine Linux.
latest
(Dockerfile)1.4.0
,latest
(Dockerfile)1.3.0
(Dockerfile)1.1.0
(Dockerfile)1.0.0
(Dockerfile)0.25.0
(Dockerfile)
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}
}
$ 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 [email protected]
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