First experiments with Docker

To try and ease the rapid deployment of WordPress sites I am thinking of using Docker images for MySQL and WordPress along with a deployment tool to pull customisations from Github.

I’ve got a few Raspberry PIs lying around at home and a wee bit of spare time to investigate this kind of setup.

First off, Find a Linux image to burn to the SD card. The links below include a couple but 1GB isn’t enough space to install additional packages.

Be warned, however, that I’m trying to prepare the SD cards on a Mac and I’m not sure it’s going to be much for resizing the Linux disk partition.

Download the Debian image and burn it to a 16GB SD card,

# sudo -s
# dd if=Downloads/hypriot-rpi-20150301-140537.img of=/dev/disk1 bs=1m

Then we need to expand the root filesystem with – I will complete this a bit later as it can’t be done on a Mac (see resources). This happens automatically when the PI is first booted.

Then boot the PI and I would advise setting a static IP address so that we don’t need the HDMI output and allow remote SSH. Reboot.

Then SSH to the PI from your workstation and grab the dockerfiles for MySQL and WordPress.

# docker run --name WordPress -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.5

The repeat for WordPress,

# docker run --name wordpress --link some-mysql:mysql -p 8080:80 -d wordpress

Okay, so the above commands are exactly correct but you get the gist and this is really a reminder of the links I need to get back to this later on. (Probably should be tracking this via an Asana task).



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s