Skip to content

Commit 09b080e

Browse files
committed
Adds WP-CLI to the image
1 parent a2a4660 commit 09b080e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ LABEL Maintainer="Tim de Pater <[email protected]>" \
44

55
# Install packages from testing repo's
66
RUN apk --no-cache add php7 php7-fpm php7-mysqli php7-json php7-openssl php7-curl \
7-
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype \
8-
php7-mbstring php7-gd nginx supervisor curl bash
7+
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-xmlwriter \
8+
php7-simplexml php7-ctype php7-mbstring php7-gd nginx supervisor curl bash less
99

1010
# Configure nginx
1111
COPY config/nginx.conf /etc/nginx/nginx.conf
@@ -35,6 +35,10 @@ RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_VER
3535
&& rm wordpress.tar.gz \
3636
&& chown -R nobody.nobody /usr/src/wordpress
3737

38+
# Add WP CLI
39+
RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
40+
&& chmod +x /usr/local/bin/wp
41+
3842
# WP config
3943
COPY wp-config.php /usr/src/wordpress
4044
RUN chown nobody.nobody /usr/src/wordpress/wp-config.php && chmod 640 /usr/src/wordpress/wp-config.php

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ Or
3232
-e "FS_METHOD=direct" \
3333
trafex/wordpress
3434

35+
### WP-CLI
3536

36-
### Inspired by
37+
This image includes [wp-cli](https://wp-cli.org/) which can be used like this:
38+
39+
docker exec <your container name> /usr/local/bin/wp --path=/usr/src/wordpress <your command>
40+
41+
42+
## Inspired by
3743

3844
* https://hub.docker.com/_/wordpress/
3945
* https://codeable.io/wordpress-developers-intro-to-docker-part-two/

0 commit comments

Comments
 (0)