Empowering IoT with Docker

2023-10-13 11:23:29
关注

Illustration: © IoT For All

As the hardware of connected devices becomes more capable and affordable, the complexity of IoT applications increases. Docker, a popular containerization platform, can help simplify and streamline the process, making it easier for developers to create and maintain IoT applications.

Let’s explore some advantages that Docker brings to IoT development and challenges to consider when deploying and maintaining them.

Advantages of Docker

#1: Lightweight & Scalable

Docker containers are lightweight, as they share the host operating system and resources, making them ideal for IoT applications where resources may be limited.

This lightweight nature also allows for easy scaling, as developers can quickly deploy multiple instances of an application without consuming significant system resources.

#2: Simplified Development & Deployment

With Docker, developers can create a consistent environment across the entire application lifecycle, from development to production. By packaging the application and its dependencies into a single container, developers can ensure that the application will run consistently regardless of the underlying infrastructure.

This simplifies the development process and eliminates the “it works on my machine” issue, making it easier to deploy and manage IoT applications.

#3: Docker Security

Docker enables developers to isolate applications and their dependencies in containers, reducing the attack surface and enhancing security. By running each application in its container, developers can limit the potential impact of security vulnerabilities and maintain better control over the application’s environment. 

Potential Vulnerabilities

Since the application is self-contained, the ability to intelligently analyze potential vulnerabilities within the context of the application is improved through contextual analysis. Taking the context into consideration helps alleviate false positives that simplistic security scanners tend to show.

As discussed in this 2023 research report, the majority of CVEs aren’t as severe as their public severity rating. By intelligently scanning in the context of the application, developers can be more productive by working on relevant potential vulnerabilities.

Easier Versioning & Rollbacks

Containers inherently make versioning and rollback more manageable by allowing developers to create new containers for each application update. If a problem arises, or new features are added, a new version can be pushed out the update of the previous release.

Because IoT devices may be deployed in challenging network environments, the update itself could be interrupted and fail. It’s useful to be able to automatically roll back to the previous version if the update fails, which could leave the device in a non-working state.

The ability to have automatic rollback capabilities is available when using JFrog Connect as the platform to manage the device updates. 

Enhanced Collaboration

Docker makes it easier for developers to collaborate on IoT projects by providing a consistent environment that can be shared across team members.

Developers can quickly spin up containers with the required dependencies, making it easier to share with other team members for testing and further development.

Docker & IoT in a DevOps Environment

Docker is simply another artifact to be managed in a DevOps environment. As such, Docker benefits from process automation for building, testing, and security and compliance checks, which are established best practices in modern DevOps. 

Challenges of Docker in IoT

Docker was originally designed with servers and data centers in mind, but its advantages of simplicity, portability, and relatively low overhead have made it a popular choice for IoT applications. That being said, IoT devices have their challenges to consider.

#1: Scalability

Deploying and updating Docker application images to a small number of devices is straightforward. However, managing deployments across hundreds or thousands of devices poses challenges. One option is to develop custom scripts, but this entails ongoing maintenance, testing, and updates. 

Alternatively, investing in an IoT management platform offers full control while automating the process. Such a platform streamlines deployments and updates and provides additional features like device monitoring, automated alerts, secure remote access, device management, and significant time savings.

#2: Size

While Docker is known for being a lightweight container, you still have to consider the application image, which can affect the overhead from Docker. If you’re targeting Linux on relatively inexpensive hardware like Raspberry Pi, you probably have more than enough power for most use cases.

#3: Network Bandwidth & Availability

IoT devices can be distributed far and wide with varying levels of network connectivity. Network access can be challenging. Networks may be slow or intermittent.

Devices will be deployed behind firewalls with no public IP address to target. You’ll need to find the device, create a secure connection, and make sure the update works accordingly. And you need to do that to the entire fleet of devices. 

In the event of a network interruption that causes an update failure, a proper IoT platform can automatically roll back to the previous instance so that the device isn’t left in a non-functional state between updates.

That’s what happened to Roomba not so long ago when their update to their Roomba vacuums didn’t go as planned. 

#4: Security

Security is usually an afterthought. Is checking for a CVE related to Docker top of mind for every developer? Probably not.

They’re working on app features, not checking for the latest vulnerabilities. That’s why it’s useful to have a built-in background process that checks for potential vulnerabilities from the CVE database while they’re coding.

Better yet, you can perform contextual analysis to mute the burden of having too many false positives that aren’t relevant. 

Proven & Efficient Solution

Docker offers a proven, efficient solution for packaging and deploying IoT applications. By leveraging Docker for IoT, you can streamline the development process, improve security, and readily scale your applications.

With the growing demand for IoT solutions, adopting Docker to deploy IoT applications to devices will simplify the development process. Implement Docker for IoT apps into your DevOps workflows, add automated security, and you’ve got IoT development with the reliability, security, and agility of modern DevOps best practices.

Tweet

Share

Share

Email

  • Connectivity
  • IoT Platforms
  • Security

  • Connectivity
  • IoT Platforms
  • Security

参考译文
用 Docker 赋能物联网
插图:© IoT For All 随着联网设备的硬件变得功能更强大且价格更实惠,物联网(IoT)应用的复杂性也随之增加。Docker 作为一款流行的容器化平台,能够帮助简化并优化开发流程,使开发人员更轻松地创建和维护 IoT 应用程序。让我们一起探讨 Docker 在 IoT 开发中带来的一些优势,以及在部署和维护过程中需要注意的挑战。---**Docker 的优势 #1:轻量且可扩展** Docker 容器是轻量级的,因为它们共享主机操作系统和资源,因此非常适合资源有限的 IoT 应用。这种轻量特性还使得应用程序更易于扩展,因为开发人员可以快速部署多个实例,而不会消耗大量系统资源。**#2:简化开发与部署** 借助 Docker,开发人员可以在整个应用程序生命周期中创建一致的环境,从开发到生产。通过将应用程序及其依赖项打包到一个容器中,开发人员可以确保应用程序在各种基础设施上都能稳定运行。这简化了开发过程,消除了“在我的机器上能运行”的问题,也使 IoT 应用的部署和管理更加容易。**#3:Docker 安全性** Docker 可以让开发人员在容器中隔离应用程序及其依赖项,从而减少攻击面并增强安全性。通过在各自的容器中运行每个应用程序,开发人员可以限制安全漏洞的潜在影响,并更好地控制应用程序的运行环境。**潜在漏洞** 由于应用程序是自包含的,因此通过上下文分析来智能地识别潜在漏洞的能力也得到了提升。考虑上下文可以帮助减少简单安全扫描器所显示的误报。正如这份 2023 年的研究报告所指出的那样,大多数 CVE 漏洞的严重程度并不如其公开的严重性评级所显示的那样高。通过在应用的上下文中智能扫描,开发人员可以更有针对性地处理相关潜在漏洞,从而提高工作效率。**更易版本控制与回滚** 容器使版本控制和回滚变得更加易于管理,因为开发人员可以为每次应用更新创建新的容器。如果出现问题或添加了新功能,可以发布新版本以取代之前的版本。由于 IoT 设备可能部署在具有挑战性的网络环境中,更新过程本身可能会中断并失败。如果更新失败,设备可能会处于无法运行的状态,因此能够自动回滚到上一个版本就非常重要。通过 JFrog Connect 这样的平台来管理设备更新,可以实现自动回滚功能。**增强协作** Docker 通过提供一个可共享的一致环境,使开发人员在 IoT 项目上的协作更加容易。开发人员可以快速启动所需的依赖项容器,方便与团队成员共享以进行测试和进一步开发。---**Docker 与 IoT 在 DevOps 环境中的应用** 在 DevOps 环境中,Docker 仅仅是另一个需要管理的工件(artifact)。正因为如此,Docker 可以从自动化构建、测试以及安全与合规性检查中受益,这些是现代 DevOps 的最佳实践。---**Docker 在 IoT 中的挑战** Docker 最初是为服务器和数据中心设计的,但其简便性、可移植性和相对较低的开销使其成为 IoT 应用的热门选择。然而,IoT 设备也有其自身的挑战需要考虑。**#1:可扩展性** 将 Docker 应用程序镜像部署到少量设备中是相对直接的。然而,在数百或数千台设备之间管理部署则面临挑战。一种方法是开发自定义脚本,但这需要持续的维护、测试和更新。另一种方法是投资一个 IoT 管理平台,从而实现对部署的全面控制并自动化流程。此类平台不仅能简化部署和更新,还提供设备监控、自动警报、安全远程访问、设备管理和显著节省时间的功能。**#2:大小** 尽管 Docker 以轻量级容器著称,你仍需考虑应用程序镜像的大小,这会影响 Docker 的开销。如果你的目标平台是像 Raspberry Pi 这样的相对廉价的 Linux 硬件,你可能已经拥有足够的处理能力来满足大多数用例。**#3:网络带宽与可用性** IoT 设备可能分布广泛,且网络连接状况各异。网络访问可能具有挑战性,可能较慢或不稳定。设备将部署在防火墙后,没有公共 IP 地址。你必须找到设备、建立安全连接,并确保更新按预期进行。并且,你必须对整个设备群执行此操作。如果网络中断导致更新失败,一个完善的 IoT 平台可以自动回滚到上一个版本,从而避免设备在更新之间处于非功能性状态。这种情况最近就发生在 Roomba 上,当他们的吸尘器更新失败时,就造成了问题。**#4:安全性** 安全性通常被视为事后的考虑。每个开发人员是否都在考虑与 Docker 相关的 CVE 呢?很可能不是。他们关注的是应用功能,而不是最新的漏洞。这就是为什么拥有一个内置的后台进程来在编码时检查来自 CVE 数据库的潜在漏洞是很有用的。更好的做法是进行上下文分析,以减少过多无关误报所造成的负担。---**经过验证且高效的解决方案** Docker 为打包和部署 IoT 应用程序提供了一种经过验证且高效的解决方案。通过利用 Docker 进行 IoT 开发,你可以简化开发流程、增强安全性,并轻松扩展应用程序。随着对 IoT 解决方案需求的不断增长,采用 Docker 将 IoT 应用部署到设备上将简化开发流程。将 Docker 集成到 IoT 应用的 DevOps 工作流中,并加入自动化的安全机制,你将获得具备可靠性、安全性和敏捷性的现代 DevOps 最佳实践。 TweetShareShareEmail 连接性IoT平台安全性
您觉得本篇内容如何
评分

评论

您需要登录才可以回复|注册

提交评论

iotforall

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

2024深圳第十二届电子信息博览会暨传感器展会

提取码
复制提取码
点击跳转至百度网盘