├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md └── wp-su.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | Dockerfile 4 | README.md -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # VS Code 2 | .history 3 | .vscode -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Installs WordPress with wp-cli (wp.cli.org) installed 3 | # Docker Hub: https://registry.hub.docker.com/u/conetix/wordpress-with-wp-cli/ 4 | # Github Repo: https://github.com/conetix/docker-wordpress-wp-cli 5 | 6 | FROM wordpress:latest 7 | 8 | # Add sudo in order to run wp-cli as the www-data user 9 | RUN apt-get update && apt-get install -y sudo less mysql-client 10 | 11 | # Add WP-CLI 12 | RUN curl -o /bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 13 | COPY wp-su.sh /bin/wp 14 | RUN chmod +x /bin/wp-cli.phar /bin/wp 15 | 16 | # Cleanup 17 | RUN apt-get clean 18 | RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tim Butler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-wordpress-wp-cli 2 | 3 | ![Docker Stars](https://img.shields.io/docker/stars/conetix/wordpress-with-wp-cli.svg) 4 | ![Docker Pulls](https://img.shields.io/docker/pulls/conetix/wordpress-with-wp-cli.svg) 5 | ![Docker Automated](https://img.shields.io/docker/automated/conetix/wordpress-with-wp-cli.svg) 6 | ![Docker Build](https://img.shields.io/docker/build/conetix/wordpress-with-wp-cli.svg) 7 | 8 | **NOTE: The official WordPress Docker images now include wp-cli as a variant** 9 | - [Official WordPress Image](https://hub.docker.com/_/wordpress/) 10 | 11 | --- 12 | 13 | This repository contains the Dockerfile for the autobuild of [wordpress-with-wp-cli](https://hub.docker.com/r/conetix/wordpress-with-wp-cli/) Docker image. 14 | 15 | The Dockerfile uses the official WordPress image and adds [wp-cli](http://wp-cli.org/). 16 | 17 | To use, simply run: 18 | 19 | docker run --name conetix/wordpress-with-wp-cli 20 | 21 | For all other configuration items, please see the official Docker WordPress [ReadMe](https://github.com/docker-library/docs/tree/master/wordpress). 22 | 23 | After you've completed the WordPress installation via the browser, you call the standard wp-cli commands via `docker exec`. For example, to install and activate the Quark theme: 24 | 25 | docker exec wp theme install quark 26 | docker exec wp theme activate quark 27 | 28 | # Development and Contributions 29 | 30 | As the official [WordPress Docker Image](https://hub.docker.com/_/wordpress/) now includes wp-cli, this project should be consided to be legacy only. Please feel free to fork for your own usage if it's still required. -------------------------------------------------------------------------------- /wp-su.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a wrapper so that wp-cli can run as the www-data user so that permissions 3 | # remain correct 4 | sudo -E -u www-data /bin/wp-cli.phar "$@" 5 | --------------------------------------------------------------------------------