skip to Main Content

Intalling wordpress on Docker. I have pushed the wordpress custom image with my plugins pre-installed on docker hub. I am ruuning wordpress using docker-compose. how to enable the installed plugins using first installation.

Dockerfile

FROM wordpress:php7.1-apache
#FROM bitnami/wordpress:latest

# WORKDIR /var/www/html

COPY wordpress-seo /var/www/html/wp-content/plugins/wordpress-seo/
COPY wp-super-cache /var/www/html/wp-content/plugins/wp-super-cache/


COPY activate-wordpress-plugins.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/activate-wordpress-plugins.sh

# RUN wp plugin activate wp-super-cache --allow-root --path=/var/www/html
# RUN wp plugin activate akismet --allow-root --path=/var/www/html
# RUN wp plugin activate wordpress-seo --allow-root --path=/var/www/html

# If downloaded via url
#wget -P /temp/plugins/ https://downloads.wordpress.org/plugin/jetpack.5.9.zip
# Extract and delete zip files
#RUN unzip '/temp/plugins/*.zip' -d /temp/plugins && rm /temp/plugins/*.zip || true;

#COPY functions.php /var/www/html/wp-content/themes/twentynineteen/

activate-wordpress-plugins.sh

echo docker-compose up -d
docker-compose up -d

echo docker exec -it $(docker-compose ps -q wordpress)  /usr/local/bin/activate-wordpress-plugins.sh
docker exec -it $(docker-compose ps -q wordpress)   /usr/local/bin/activate-wordpress-plugins.sh

Plugins are installed but not activated.

2

Answers


  1. First install the docker in order to enable it.

    follwing example show that it is enabled or not.
    $ docker plugin ls

    ID NAME TAG DESCRIPTION ENABLED
    69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker false

    Use this command to enable

    $ docker plugin enable tiborvass/sample-volume-plugin

    tiborvass/sample-volume-plugin

    $ docker plugin ls

    ID NAME TAG DESCRIPTION ENABLED
    69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker true

    Login or Signup to reply.
  2. Once you integrate the wordpress cli into the image or run seprate wpcli image using compose file. You can simply use wp-cli commands to activate the plugins and install wordpress.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search