Prerequisites:

Follow the instructions on my first blog post about how to get docker set up

 

Now to the good stuff

Let’s just dive in and clone the docker new-backup branch

git clone ssh://git@git.uoregon.edu/uo_drpl_dev/drupal_docker.git -b new-backup

grab your backup.tar.gz from central by clicking Export and then Get. After downloading it put it in the drupal_docker folder.

backup

Install and open kitematic from kitematic.com current version is 0.7.2

From Kitematic open a terminal.

docker cli

cd into the drupal_docker folder we checked out earlier it should look something like this:

kitematiccli

and you’re all set to get this backup up and running by running start.sh:

./start.sh

startsh1

startsh2Here we want to start the container and normally we will say yes to binding on 80,443, and 3306 because this gives us https access to the site. The only real time you’d want to say no to this is if you’d like to run multiple backups at the same time and you don’t care about https.

Now we are greeted with a fun interactive menu.

startsh menu

Really for kitematic users the only part we care about this is the task menu portion. We can make modifications to the makefile in our extracted directory and rebuild from it. We can restart apache if need be, run a drush registry rebuild, make a snapshot of the mysql database, enter the mysql CLI in the container, or open a shell at the site directory location to run additional drush commands in the container.

Show me the goods already!

kitematic home

We see the logs of apache running in the terminal and if we click the red highlighted web preview area we get our backup opened in the default browser.

page

Notice the web address is not in the local subnet. This is because Kitematic runs a headless virtualbox instance with docker inside of it. If we change this to https://192.168.99.100 we get a self-signed certificate warning and after accepting your imminent death you can access a secured version of the site.

To show what ports kitematic opened to the docker VM (80,443,3306) click the settings tab and then ports:

kitematic ports

You can point navicat or some other gui mysql at 192.168.99.100:3306 and access the database with drupal:drupal.

Misc. things

After the first time you extract the image it will not re-extract the backup over your files so you don’t have to worry about the docker image being deleted after use. You can always rebuild the docker and if the directory matching the tar.gz exists it will not be overwritten. This allows you to change the makefile and run the rebuild from makefile option or replace the database.sql file and have the next docker created use the new database.

This extracted directory structure includes the full platform, your files are buried underneath the platform in the sites directory as shown below.

dir structure

Enjoy