I use Terraform to provision instances, and then Ansible to load containers on to them.
I don’t personally use Docker Cloud, but it looks like you just need to make sure its agent process is running on your target node. For that matter, the (dangerous) curl command shown on that page could be run from a Terraform provisioner block.
For non-trivial things, this is the the domain of Ansible (Salt, Chef, Puppet). For trivial things, use a Terraform provisioner block (maybe attached to a null_resource resource).
Both of these are things Terraform does well. (I’m on AWS, and eventually realized it is easy to just always create a Route 53 DNS record for every instance I create; I avoid needing IP addresses directly as much as I can.)