Pradeep Singh | 25th Jun 2017
Docker’s tagline “build, ship, and run” sounds very promising for the massive number of IoT endpoints planned to be deployed in coming years. Gartner estimates more than 20 billion interconnected devices will be deployed by 2020.
Containers natively support all the features required to run an application on resource constrained IoT Devices. They are portable and efficient, allow quick application deployment and rapid application scaling. IoT frontend applications would benefit the most with Container model as it will make it easy to deploy, run and upgrade the applications, using container orchestration tools like Kubernetes.
Let’s explore some of the key container features, that may help you create a great IoT solution –
1. Easy and Rapid IoT Application Deployment:
With Docker Containers you need not worry about setting the base environment on the Operating System with the Application dependencies. Containers wrap the software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server OS.
- Application Portability across IoT Devices – An application and all its dependencies such as Sensor-specific libraries can be bundled into a single container that is independent of the host version of Linux kernel, platform distribution, or deployment model.
- Docker Containers/Images are Lightweight – Docker images are typically very small in size, which facilitates quick application spin-up and fast shipping between hosts. Compact container size also reduces the time to deploy new application containers.
- Easy Application Upgrades – To update your application all you need to do is – Implement changes in your Docker File and replace old containers with the new image. To rollback simply replace new image with old one. Containers make patching a software bug really easy.
- Simplicity & faster configurations – Users can take their own configuration, put it into the code and deploy it without any problems. As Docker can be used in a wide variety of environments, the requirements of the infrastructure are no longer linked with the environment of the application.
- Software Version Control and Component Reuse – Containers allow you to control the issues caused by software bugs in new code releases. You can track versions of a container, inspect differences, or roll-back to previous versions. Containers reuse components from the preceding layers, that makes upgrade process noticeably lightweight and quick.
- Sharing – You can use a remote repository to share your container over the network.There are several service providers that provide a registry for this purpose. It is also possible to configure your own private container repository.
Docker containers provide an excellent platform for microservices. When it comes to the IoT, microservices-driven architecture makes more sense than monolithic application stacks. Slim and Atomic microservices can easily operate with minimal resource overhead.
Following are some of the advantages of running IoT microservices on Docker Containers –
- Scalability – Microservice architecture supports scaling the infrastructure both horizontally and vertically giving long term benefits to the IoT deployments.
- Programming Language Agnostic – Each microservice can be developed in a different programming language such as Java, C, C++, Python, etc and still communicate with each other using Web APIs (REST / SOAP) or Message Brokers (MQTT, AMQP etc).
- Modularity – Microservices would allow you modularise your IoT Application logic at a granular level. For example, you may design different microservices for Communication Services (WiFi, Bluetooth, Zigbee etc), IoT Device Management Services, IoT Gateway Applications, Authentication and Security modules etc.
- Easy Troubleshooting – In the case of microservice failures, it’s easy to isolate and troubleshoot the problem compared to monolithic applications. Considering the scale at which we deploy IoT applications, this could prove to be one of the most useful features.
Security is one of the most important aspects in the IoT. As per Gartner, Applications deployed in Containers are more secure than the Applications deployed on bare OS. This is because even if a container security is compromised, it will not impact other containers running on the host OS as applications and users are isolated on a per container basis.
Following are some the key points related to container security –
- Resource Isolation – Containers provide the better defense with isolation at PID, Network, and other Namespace levels. No Docker container can look into processes running inside another container. From an architectural point of view, each container gets its own set of resources ranging from processing to network stacks.
- Limited Libraries and Tools – Containers have only the libraries that your application needs. This results in smaller attack surface with restricted access to the Linux OS Tools used by the hackers.
- Whitelisting – Containers are mainly used for Microservices with a well-defined interface to communicate with other sets of services. Microservices make it easier to whitelist the Network Ports and application permissions on a Container.
- Security Scan – Docker also provides Security Scan Services with Docker Cloud and Docker Hub. These services can scan your containers for Security vulnerabilities.
4. Multi-Cloud Platforms:
One of Docker’s greatest benefits is portability. You may create your IoT application locally and deploy it in Public Cloud platform of your choice. Docker containers can be run inside an any Cloud instance provided that the host OS supports Docker. Over last few years, all major cloud computing providers, including Amazon, Google, Microsoft have embraced Docker’s availability and added individual support.
Following are some of the Public Cloud Providers that support Docker Containers in some form or shape –
- Docker Cloud – Docker’s official cloud service for Swarm provisioning, managed Registrstry Service, continuously delivering Docker applications and more.
- Amazon EC2 Container Service -Amazon EC2 Container Service (ECS) is a highly scalable, high-performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances.
- Microsoft Azure Container Service – Choose the tools and solution that best suit your needs for Docker container orchestration and scale operations. Use the Mesos-based DC/OS, Kubernetes, or use Docker Swarm and Compose for a pure Docker experience.
- Google Container Engine for Docker Containers – One-click Kubernetes clusters, managed by Google. Container Engine is a powerful cluster manager and orchestration system for running your Docker containers.
- Oracle Container Cloud Service – It provides an easy and quick way to create an enterprise-grade container infrastructure.
5. Continuous Integration and Continuous Delivery Automation (CI/CD)
Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day.
Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently.
Since Docker can integrate with tools like Jenkins and GitHub, developers can submit code in GitHub, test the code and automatically trigger a build using Jenkins, and once the image is complete, images can be added to Docker registries.
Docker containers with features like quick and easy deployment with small container image footprint may prove to be the key enabler for the Internet of Things. IoT Applications developed with microservice architecture would benefit most from the Docker containers. Please feel free to relay your comments, suggestions or corrections.