Docker

Tutorials and guides on using Docker to contain and manage web applications

How to put your Docker image on a diet

Docker

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 remove a stale PID from a Docker container

Docker

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.