Commit 902206ad authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add the WP-CLI tool to the wordpress image

parent 321e04ea
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -28,15 +28,15 @@ LABEL uk.org.kodo.maintainer "Dom Sekotill <dom.sekotill@kodo.org.uk>"

COPY --from=compile /usr/local/etc/php /usr/local/etc/php
COPY --from=compile /usr/local/lib/php /usr/local/lib/php
COPY wp.sh /usr/local/bin/wp
ADD https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar /usr/local/bin/wp.php

WORKDIR /app
VOLUME /app/wp-content
ENV WORDPRESS_ROOT=/app

ARG wp_version=latest
ARG wp_sha1=
ADD install.sh /install.sh
RUN /install.sh "${wp_version}" "${wp_sha1}" && rm /install.sh
RUN wp core download --skip-content --locale=en_GB --version=${wp_version}

COPY opcache.ini /usr/local/etc/php/conf.d/opcache-recommended.ini
COPY entrypoint.sh /bin/entrypoint
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ get_latest() {
}

get_version() {
	echo "${UPSTREAM_VERSION}"
	docker run --rm $1 wp core version
}

build() {

wp.sh

0 → 100755
+6 −0
Original line number Diff line number Diff line
#!/bin/sh
# Lets not beat about the bush, preventing the tool which installs WP from 
# installing it as root is idiocy. WP needs to be installed owned by a user 
# seperate from the server's user. 'root' is available for such, besides which 
# root in a container is not really root.
exec php /usr/local/bin/wp.php --allow-root "$@"