I have been meaning to write about Docker and Tutum for quite a while now. I absolutely love Docker, it has become a natural part of the toolset I use when building software - and Tutum picks up right after the code I write leaves my MacBook and is ready for testing and production environments.
So what is Tutum? Tutum is a cloud service that leverages the power of Docker with a massively helpful GUI. If you already use Docker and you are familiar with the basics (images, containers, Dockerfiles etc.) you will probably get the jist of how Tutum works quickly. Here is a quick rundown of the different areas inside the Tutum Dashboard.
Nodes & node clusters
A node is a host that runs Docker and the Tutum Agent software. You can install the Tutum Agent on your own server or connect your account to a cloud provider and setup new nodes with a few simple clicks.
The beauty of using a cloud provider is that the nodes you create are actually node cluster configurations - if you need one or several more machines just like the one you have you can simply drag a slider to launch more nodes.
The screenshot above shows what it looks like when you create a node on Digital Ocean, via Tutum. Note the Deploy tags settings, these tags are a powerful Tutum feature that allows you to target specific nodes when deploying services. This feature is such a vital part of Tutum that I will cover it in another blog post!
Available cloud providers
- Digital Ocean
Supported linux versions
In Docker terms, a Service corresponds to a built Dockerfile.
When you launch a service you specify an image and any other options you might want. In the Tutum dashboard you can edit environment variables, ports, autoredeploy settings and much more. You can also give a service one or more tags to control where your service will run, combined with the deployment strategy setting this gives you a fine-grained control over how and where your service will be deployed.
The autoredeploy setting is very useful if you often update your image and you always want the service to run the latest version. It will make sure the service restarts once a new image version is detected. This goes for images in your private Tutum repository.
Apart from building and running your own images/services there are many, many public images that are ready to use. When you create a new service you are given the option to use any of the jumpstarts or search the Docker Hub public repository.
Tutum allows you to store your own docker images. You can either build and push them manually, or you can connect Tutum to your GitHub account. If you have a repository with a Dockerfile in it, Tutum can build a republish a new image upon every push. Pushing your own image is easily done with your local docker or, say, from a build server.
# Login - only needed the first time you are about to do this. docker login tutum.co
# Build, tag and push docker build -t my-service . docker tag my-service tutum.co/ilix/my-service docker push tutum.co/ilix/my-service
Finally, there is the Stack feature. Stacks are great for two reasons. One being that when you have a bunch of services on your account, using stacks will help you know what service belongs where. Second, you are probably (I hope) using Docker Compose locally when building your software. Why is this useful? Well, the docker compose yaml uses virtually the same syntax as Tutum's stack files, meaning you can easily port your local development setup to a Tutum stack.
A stack file might look like this:
Once you have created a stack you will notice that the Edit button only takes you to a textarea where you edit your stack yaml. If you find this a bit uncomfortable - just go into one of the services and edit them directly instead. Anything you edit on a service belonging to a stack will be reflected in the stack yaml!