SW engineering, engineering management and the business of software

Simply put, I think docker is going to change the game. Anyone who has any interest whatsoever in devops better be paying attention.

The best part for me about docker is that I can iterate very, very quickly on getting images the way I want. If I am installing a VM, and I screwup a step, reinstalling ubuntu from scratch is no fun. Spinning up a new docker container or image takes less than half a second.

# grab the container id (this will be the first one in the list)
docker ps -a
docker commit <CONTAINER_ID> <YOU>/<CONTAINER_NAME>

Run the container as necessary, confifguring ports, using detached mode what not.

At this point you have a docker image (like a snapshot) of a clean install of WHATEVER. Running a container will load the image as a starting point and then allow you to configure as necessary. Screw up the conf file? Just exit the container and start over. The pipeline reversal penalty is minimal.

FIRST RUN:

First launch back into a new container, but this time with a data directory mounted. This example uses a host folder at $HOME/mysqldata. Inside the container the directory is mapped to /data. This makes it easy to spin up different instances of MySQL without having to be constantly configuring new data dirs.

Running

At this point, you can access MariaDB at the host IP address and the forwarded port (usually 49xxx).

Tips

Iterate! Did you screw up the mysql_secure_installation step? Just exit the container and start from your last docker commit. Docker is all about iterating repeatable steps until you have an image ready to go.