Why

Easy steps to create and deploy your applications locally
and push to any cloud provider using the same toolset.

What

Docker Engine

Docker, more specifically Docker Engine,
is a popular framework to run applications in containers.

It however only gives to the tools to manage one container at time.
There is no way to associate containers with each other,
beyond basic linking for IP and port aliasing,
and sharing folder volumes, nor ability to act on linked containers in one command.

Docker Compose

Fig.sh was a great solution to this as it is
a tool to orchestrate multiple containers into one system architecture.
E.g. you might have a database container,
a API based business application container
and a front end application container.
You configure these as 3 containers, tell Fig how they connect and off you go.

Docker Machine

Docker is usually running locally or hosted inside the excellent boot2docker,
or a Vagrant instance,
as detailed in my Docker with OSX and Ubuntu howto.
Docker Machine lets you create a Docker host VM locally or on a cloud provider in one command.

Docker Swarm

Docker Swarm lets you create a cluster of Docker Machine instances, so that they appear as one instance host.
This works locally as well as on cloud providers.

Local Machine

This will download boot2docker as a local VM.
and allocate 3GB as memory.
And suggest you update your default settings,
basically replacing the original boot2docker settings,
and add these to your .bash_profile or config.fish.
(my dotfile)

Set the environment properties for which machine's docker daemon to communicate with.
If you use Bash:

Install Swarm

Orchestrate

Lets create a common basic 3 system architecture.
One database based on Postgres.
One API service application based on Spray.
One simple frontend application based on Play.

The frontend talks to the API and the API talks to the database.

My preference for all things Scala is obvious, you might want to pull in other tech stacks instead.

Clone my example code or you can install a Java JDK
and Typesafe's Activator
to manually create the project.
The example code use Java and Activator inside Docker images so you don't need to install them.

Amazon AWS

As always, create an account with Amazon AWS EC2 if you do not already have one,
and log into to the AWS console.
AWS also give you a generous trial to experiment with.

I recommend a separate IAM credentials to use for this
as these keys will be exposed in your shell history.
Depending on your security settings,
you may need to add the IAM user to an IAM group as well.

Create a normal VPC, noting the VPC id, the region and zone you created it in.
You will also need to find what the public subnet id that the vpc is in.

Scale the cloud

We have created just one machine instance for Docker in a cloud provider(s).
If you plan to keep adding orchestrations to it
or want to scale more horizontally for capacity and reliability
then you need more instances.
And as mentioned Swarm handles this and still exposes it as just one instance.

Compose & Swarm issues

Using Swarm with Compose has had some issues,
mostly due to routing requests correctly and efficiently between Compose apps across Machine instances.
There has been some temporary work arounds.