Completing WordPress Health Check inside Docker

Missing Modules

It is very tempting to simply use the official WordPress Docker image. However, new feature HEALH CHECK in 5.X – you will observe a recommendation – something like following:

Missing Modules in WordPress Docker

To sum up – bcmath, exif and imagick are not installed in wordpress docker image by default.

Resolution

The same way we added Imagick in PHP Docker, You can create your own Dockerfile instead of using image directly as following:

FROM wordpress:5.2.0-php7.3-apache
# Better WordPress Health-Check
# Install Imagick
RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN printf "\n" | pecl install imagick
RUN docker-php-ext-enable imagick
# Install bcmath and exif
RUN docker-php-ext-install bcmath exif

Great Job! Everything is running smoothly here.

Tell your network!

How to install Imagick in PHP Docker?

The PHP docker image is build from the source and hence the usual apt-get install php-imagick doesn’t work at all. This might be frustrating for you as most of the solutions have a version attached to it. However, I found a way to always have it updated. Here is how –

Dockerfile for Imagick

This is how docker file should look like:

FROM php:7.3-apache
RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN printf "\n" | pecl install imagick
RUN docker-php-ext-enable imagick

Build Output

....

configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
Removing intermediate container 1c032fba6d45
 ---> 517795f672ac
Step 4/4 : RUN docker-php-ext-enable imagick
 ---> Running in 976ecd4a9627
Removing intermediate container 976ecd4a9627
 ---> 4b978dd49756
Successfully built 4b978dd49756

Git Repositor and Docker

Tell your network!

SpaceBox – Docker Development Box on SpaceVim

I have created SVIM which is a dockerized version of VIM. However, some of the most imporant plugins I was using is no longer maintained for VIM but are compatible and focussed on NVIM. Thus, I switched to SpaceVim. Despite there is an official Docker of SpaceVim, it is lacking the support of languages as required tools are missing in the docker particularly Go lang hints. Hence, I created my own version of SpaceVim and I ensured that all the stuff I use is working properly. If you are PHP developer, JavaScript developer, Golang Coder or even if you create simple HTMLs – you have everything you need. I haven’t focused on Java or alike line languages like scala or for that matter Objective C. This is ideally for the Web Developer and not for the Mobile App Developer. Though, feel free to send a PR. I am calling it SpaceBox – a dockerized SpaceVim

Why should you use SpaceBox?

How to use it?

alias vbox='docker run -ti -e TZ=Asia/Kolkata -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -e TMPDIR="/tmp/" -e TERM=xterm -e GIT_USERNAME="Your Name" -e GIT_EMAIL="YourEmail@Stealer.com"  --rm -v /etc/timezone:/etc/timezone:ro -v $HOME/tmp/:/tmp/ -v ~/.ssh:/home/spacevim/.ssh -v $(pwd):/home/spacevim/src varunbatrait/spacebox'

Tell your network!