After its good service and with ZFS on Linux becoming stable, I have decided to move away from FreeNAS and install a plain Ubuntu 16.04 server image to play with docker and ansible and enjoy destroying and re-spawning my ephemeral service instances in seconds!
Whether ansible and docker really are a natural fit is hard to say, with so many tools appearing on the horizon of service composition, but it seems good enough for my home use case (i.e., a small server that I use to run a few services for myself).
With ZFS as a base (everything happens on a zpool with a redundant vdev), datasets can be quickly prepared to be used as docker volumes. This gives the advantage of really managing the storage in a “software-defined” way, with the nice ZFS snapshot and send/receive tools to move your data around and do backups. Ansible brings it all together: with the docker module it is quite easy to provision containers and then wire them together and change the configuration as needed.
These days I wrote a playbook to setup owncloud with a mysql database and HTTPs, starting from the official owncloud and mysql containers from docker hub. My naive intention was to keep the images intact and change them after instantiation, with the hope that I will be able to use this playbook even when they get updated.
Here’s a diagram showing what the playbook deploys within the docker host (except the zpool which must be pre-provisioned):
After the playbook runs, pointing the browser to
should give you the login page to owncloud (admin credentials to be specified as an ansible variable).
Feel free to try, improve, blame it: https://github.com/vincepii/ansible-docker-owncloud