Deploy your service on the cloud

In the previous post we created Swarm service, deployed our greeter service, scaled it and even touched a bit the high availability feature of Docker Swarm.

In this post, we will go to the Cloud!

Docker Cloud

In this post I am going to show you how to deploy to Docker cloud, which would open up (Amazon Web Services, and Microsoft Azure among others)

I may do other posts to illustrate Cloudfoundry/Heroku/Openshift... for completeness sake.

Most of this post is a reduced write up of Introduction to Docker Cloud to get you started quickly.

Link to an infrastructure

Docker Cloud supported infrastructures are:

  • Amazon Web Services
  • Digital Ocean
  • Microsoft Azure
  • SoftLayer
  • Packet

You can also Bring Your Own Node! Basically, you'd have to launch a command on your host and open up some ports.
(This is to be discussed with security team if we want to permit that on premises)

Linking to Amazon Web Services

I used here my personal Amazon Web Services account to showcase this.

docker-cloud-link-aws

All you need for this is your ARN.

If you know it, just click the pen icon and paste it. Otherwise, you'd have to follow this page if you do not have/know your ARN

Deploy a node

In order to run a container we need a node. To create one on Docker Cloud,

docker-cloud-node-cluster-add

Click Create to create a Cluster

docker-cloud-node-cluster-create

Fill in it's name, your provider, the region, number of nodes, disk size...

click Launch node cluster and wait a bit :)

Deploy our Greeter service

Time to deploy our service. Like we already saw in the previous post, a service is a group of containers linked to an image:tag, handles easily load balancing, fault tolerance and many other aspects.

So, let's create our service on the cloud.

  1. Navigate to Applications/Services
  2. click Create
  3. Fill in some information related to the service, mainly the image:tag, the port to publish (Remember docker -p ?)
  4. Click Create/Deploy

Make profit

You'll have to wait for a bit, but if you played nice till now, Docker Cloud should show you the URL of your deployed service in the endpoints.

docker-cloud-endpoints-section-url

If I open the URL in a browser, I get greeted from Docker Cloud.

docker-cloud-myservice-live.png

What's Next?

If you got to this point, well, I salute you.

I barely touched on the subject of Docker Cloud in particular and the other providers in particular. There is still a lot to test/explore!

In Docker Cloud you can autoscale based on triggers, link containers, define stacks (collection of services - docker compose anyone?) and of course Docker Cloud CLI for the command line addicts out there. (Of course it runs in a Docker container...)

The next post introduces the rolling upgrade feature, clustering management to drain a node and some visualization tools.

There is still the road of which technical stack we are going to use, how our internal teams are going to work together, and the story which we took to go to the cloud to write.

Let's write it together.

puss-in-boots