Articles and projects relating to 'Docker'

How to put your Docker image on a diet


I recently delivered a presentation at PHP South West about how to put your Docker image on a diet. The talk mentioned six points that help reduce the size of a Docker image.  The majority of the points focused on improving the Dockerfile and the last point was based on using a .dockerignore file. This post […]

How to rename a WordPress URL in MYSQL


This is how you can rename a WordPress URL using a SQL script. This can also be done against a Docker container.
The script requires two variables to be set. The first is the old site name and the second is the new site name.  I’ve included some examples of how to set and pass these variables into the SQL file.

How to remove a stale PID from a Docker container


Sometimes my Apache 2 Docker container refused to restart because the previous Apache PID was active.
The error I got was httpd (pid 1) already running in the docker container. Usually this happened after docker-machine refused to shut down properly or the Docker container stopped unexpectedly.
I got around this by writing a simple script that removes the stale PID files from the apache2 Docker container upon startup.
The script has been working without issue for the past month so I’ve decided to share it.