Open Source IoT
Cloud Containers
In Docker Primer, you ran multiple containers on your local machine: a Realtime container that connected to a Redis container. The Redis container is based on the Redis container image on Docker Hub. The Realtime container is built from custom Go code. The Realtime container exposes a web page at http://localhost:8888 that connects to http://localhost:888/socket.io for realtime updates. The protocol used to obtain real time updates is either XHR Polling or WebSockets. The diagram below illustrates the setup:
In the next section, we will look at running these containers (Redis and Realtime) in a public cloud context. In this book, we will primarily use Microsoft Azure.

Azure Container Instances

With Azure Container Instances (ACI), Azure provides a simple way to run one or more containers in a container group. Continuing with our socket.io example, we will run the Redis and Realtime containers in such a group.
If you do not have access to an Azure subscription, go to https://azure.microsoft.com/en-us/free/ to obtain a free account. Simply follow the steps after clicking the Start Free button. When you are done, you will see the portal:
Click + Create a resource and then click Containers. Container Instances are listed under Kubernetes Service:
The portal is great if you want to run one container. If you want to run multiple containers in a container group, you will need to create a YAML file or an Azure Resource Manager (ARM) template. We will use a YAML file first and then show the corresponding ARM template. Whether you use a YAML file or an ARM template, in both cases you will need to use a command line to submit a deployment task.
Copy link