Updating Wordpress Plugin Inside Docker Container

Here is my scenario:

I am developing a plugin that will change very often, I need to create an image using dockers in which a new version of wordpress is installed, and then import the entire database and plugins from the development environment (see on github)

I managed to install wordpress on docker using https://github.com/eugeneware/docker-wordpress-nginx

Now here are my questions:

1 - is there a way to change Wordpress files and folders after it was installed in the docker (for installing plugins and using the command line, not the Wordpress GUI)

2-If I want to achieve what I explained above, what is the best workflow?

+7
docker wordpress wordpress-plugin
source share
1 answer

Two possible answers to your problem. I am also struggling with this now, so YMMV.

Firstly, if you use the Docker container on your host, you can always pause its docker pause , create a new image from the working docker commit container, and then push it to the docker push private repository (a Live Wordpress install is probably not suitable for Public Docker Hub). After that, you can resume the docker unpause container, and then you can update the image on your dev system. Then come back after updating and testing, and everything will be fine, and then docker pull image and restart the service so that it uses the new image.

Not a great solution, but it will work.

Based on Tadeusz's comment, I will not necessarily run your entire WP installation from the data volume. They are unstable, and if for any reason your container is deleted and it will be the only one referencing data volumes, then you will lose everything (if you do not keep several backups - you keep several backups, right?)

Another solution that I am considering is that the plugin changes are deployed as part of the Docker file. A much more deliberate approach, but can be configured to automatically create a new Docker image when you commit to the Github repository. It discusses the implementation of this automatic build process here . To complete the administration of the server on your final hosting, you will need to place a new image, as I mentioned above. And done.

Of course, setting this option remains as an exercise for your dev system.

Hooray!

+5
source share

All Articles