https://www.iotworldtoday.com/wp-content/themes/ioti_child/assets/images/logo/mobile-logo.png
  • Home
  • News
    • Back
    • Roundups
  • Strategy
  • Special Reports
  • Business Resources
    • Back
    • Webinars
    • White Papers
    • Industry Perspectives
    • Featured Vendors
  • Other Content
    • Back
    • Q&As
    • Case Studies
    • Features
    • How-to
    • Opinion
    • Podcasts
    • Strategic Partners
    • Latest videos
  • More
    • Back
    • About Us
    • Contact
    • Advertise
    • Editorial Submissions
  • Events
    • Back
    • Embedded IoT World (Part of DesignCon) 2022
Iot World Today
  • NEWSLETTER
  • Home
  • News
    • Back
    • Roundups
  • Strategy
  • Special Reports
  • Business Resources
    • Back
    • Webinars
    • White Papers
    • Industry Perspectives
    • Featured Vendors
  • Other Content
    • Back
    • Q&As
    • Case Studies
    • Features
    • How-to
    • Opinion
    • Podcasts
    • Strategic Partners
    • Latest videos
  • More
    • Back
    • About Us
    • Contact
    • Advertise
    • Editorial Submissions
  • Events
    • Back
    • Embedded IoT World (Part of DesignCon) 2022
  • newsletter
  • IIoT
  • Cities
  • Energy
  • Homes/Buildings
  • Transportation/Logistics
  • Connected Health Care
  • Retail
  • AI
  • Metaverse
  • Development
  • Security
ioti.com

Embedded Computing


Thinkstock

Training and Development on the Mechanism of Metal Gears. in the design of information related to business

How to Run Docker on IoT Devices

Here’s how to run Docker on IoT devices, which enables you to bring container-based app development to the edge.
  • Written by Dan Sullivan
  • 3rd February 2021

Running Docker on IoT devices offers advantages by bringing containers to the edge. In the following discussion, the focus is on implementation issues, starting with installation.

In life science research, biologists use model organisms such as mice to learn things that apply to similar organisms. In this exercise we’ll learn using a Raspberry Pi as our version of mice. Other devices may require a slightly different set of operations, but the principles are the same.

Installing Docker is almost trivial, thanks to the Docker install script available at get.docker.com.  From a command line on the device, update the package manager with the following code:

sudo apt update -y

Then, use curl to download Docker itself. The command for that is the following:

curl -sSL get.docker.com -o get-docker.sh && sh get-docker.sh

Curl is a command line utility for transferring data using any of  several protocols.  The parameters indicate the operation should display minimal log messages, (aka silent mode)but show error messages on a failure (-S), and follow any redirects if the page has moved.

The output of the curl command is written to the file get-docker.sh. The command finishes by running the get-docker.sh shell script, and that get-docker.sh downloads the appropriate Docker for the platform.

Once you download Docker, specify a user that will run Docker commands. To add permissions to the user pi (or some other user) so that it can run Docker, use this command:

Sudo usermod -aG docker pi

This adds the user pi to the docker group.  At this point, you should be able to successfully run the Docker hello-world service to verify that the installation succeeded with the following command:

docker run hello-world

Docker allows you to build images and run containers, which are time savers when developing applications for the cloud and the edge. Typically, the ratio is to run one service per container but many applications require multiple services and therefore multiple containers.  The tool for managing the deployment of multiple containers is called Docker Compose.  Docker Compose is written in Python and has some library dependencies, which need to be installed. The command is the following:

sudo apt-get install -y libffi-dev libssl-dev

will install a foreign function call library and an ssl library.  You will also need to install Python 3 with this command:

sudo apt-get install -y python3 python3-pip

With all the dependencies in place, the next step is to install Docker Compose with this command:

sudo pip3 install docker-compose

The device is now ready to run Docker images. Images can either be downloaded from a repository or built from a base image.  When you run Docker on IoT devices, it’s critical to use images that are built for the platform of the IoT device. Raspberry Pi, for example, is built on the ARM platform, so it doesn’t support images created for Intel or AMD architectures.

Docker images are available within the Docker registry. When searching for images, include the term “ARM” in the search string. ARM images will have names such as “arm64v8/alpine” or “arm32v6/alpine.”

For developers who want to deploy their own application using Docker, start with a base image and build on that.  Since resources on IoT devices are limited, it is best to start with a small, minimalist image. Alpine is a lightweight Linux distribution that is used widely as a base image for Docker containers. The potential drawback of using a lightweight operating system is that you need to install a number of dependencies. They may be available by default in other Linux distributions.

If you are interested in working with Raspberry Pis, consider using HypriotOS, which is specifically designed to get Docker up and running on the platform as fast as possible. The open source project includes raw images, a tool to flash SD card images and support for Docker Compose.

BalenaOS is another host operating system tailored for Docker with a focus on IoT and cloud support. This is a minimal Linux distribution, which keeps the OS footprint small, but it also supports networking in harsh or unreliable conditions. BalenaOS is based on Yocota Linux, a distribution designed for customized embedded systems.

Enterprises are increasingly adopting Docker because it supports distributed, dynamic, and complex applications.

 

Tags: Edge computing Embedded Computing Technologies

Related


  • IoT and Drones Automate Field Operations
    IoT-enabled drone technology has brought cost and operational efficiency to various industries.
  • Training and Development on the Mechanism of Metal Gears. in the design of information related to business
    Using Low-Code and No-Code in IoT App Development
    Developing applications for the Internet of Things is no easy feat. Connected things typically involve the integration of a disparate mix of technologies, including back-end systems, IoT endpoints, other platform and data sources. Additionally, companies that aim to build Internet of Things( IoT) applications need developers with specialized skills that allow them to configure and […]
  • Semiconductor Industry Growth Spikes, But Supply Remains Constrained
    Demand for semiconductors is white-hot as remote work and the appetite for consumer electronics continue unabated. But supply chain dysfunction could threaten semiconductor industry growth.
  • IoT security
    IoT Device Security at the Edge Poses Unique Challenges
    IoT device security at the edge is running up against the limits of traditional data center methods to secure edge devices.

Leave a comment Cancel reply

-or-

Log in with your IoT World Today account

Alternatively, post a comment by completing the form below:

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Content

  • Jetting to the Stars Using Containers for Development
  • ‘Edge NLP’ Is About Doing More With Less
  • Network Connectivity Paves Way, with Caveats, for IoT Adoption
  • 5G in Manufacturing Shows Promise, but Rollouts Are Incremental

Roundups

View all

IoT Product Roundup: PTC, Nokia, Arm and More

19th May 2022

IoT Deals, Partnerships Roundup: Intel, Nauto, Helium and more

14th May 2022

IoT Product Roundup: Amazon, Synaptics, Urban Control and More

27th April 2022

White Papers

View all

The Role of Manufacturing Technology in Continuous Improvement Ebook

6th April 2022

IIoT Platform Trends for Manufacturing in 2022

6th April 2022

Latest Videos

View all
Dylan Kennedy of EMQ

Embedded IoT World 2022: Dylan Kennedy of EMQ

Dylan Kennedy, EMQ’s VP of global operations, sat down with Chuck Martin at Embedded IoT World 2022.

Embedded IoT World 2022: Omdia’s Sang Oh Talks Vehicle Chip Shortage

Omdia’s automotive semiconductor analyst sits down with Chuck Martin at this year’s event

E-books

View all

How Remote Access Helps Enterprises Improve IT Service and Employee Satisfaction

12th January 2022

An Integrated Approach to IoT Security

6th November 2020

Webinars

View all

Rethinking the Database in the IoT Era

18th May 2022

Jumpstarting Industrial IoT solutions with an edge data management platform

12th May 2022

AI led Digital Transformation of Manufacturing: Time is NOW

9th December 2021

Special Reports

View all

Omdia’s Smart Home Market Dynamics Report

7th January 2022

Cybersecurity Protection Increasingly Depends on Machine Learning

28th October 2020

IoT Security Best Practices for Industry and Enterprise

20th October 2020

Twitter

IoTWorldToday, IoTWorldSeries

Europe’s First Automated Gas Station Convenience Store dlvr.it/SR45J9 https://t.co/eDJDJ7CxkI

25th May 2022
IoTWorldToday, IoTWorldSeries

Zero-Emission, Autonomous Cargo Ship Under Development dlvr.it/SR3xgb https://t.co/3oU7CrKWkW

25th May 2022
IoTWorldToday, IoTWorldSeries

Hannover Messe 2022: 5 Key Themes at This Year’s Show dlvr.it/SR3wtW https://t.co/j0fQUiU2LW

25th May 2022
IoTWorldToday, IoTWorldSeries

Can AI Help Stop Mass Shootings? dlvr.it/SR3tqK https://t.co/VxPBdajWA3

25th May 2022
IoTWorldToday, IoTWorldSeries

China has revealed an autonomous marine drone carrier dlvr.it/SR3qXs https://t.co/yMiiqeMNrZ

25th May 2022
IoTWorldToday, IoTWorldSeries

ISQ’s #UAV inspection drones will be on display at this year’s @hannover_messe dlvr.it/SR35dg https://t.co/U6QOQtMbGw

25th May 2022
IoTWorldToday, IoTWorldSeries

👀 Looking to integrate #AI into your manufacturing process? Explore how #manufacturers can begin the process of… twitter.com/i/web/status/1…

25th May 2022
IoTWorldToday, IoTWorldSeries

The U.S. Army is getting a 5G boost for #AR #VR capabilities from #5G network provider @OceusNetworks.… twitter.com/i/web/status/1…

24th May 2022

Newsletter

Sign up for IoT World Today newsletters: vertical industry coverage on Tuesdays and horizontal tech coverage on Thursdays.

Special Reports

Our Special Reports take an in-depth look at key topics within the IoT space. Download our latest reports.

Business Resources

Find the latest white papers and other resources from selected vendors.

Media Kit and Advertising

Want to reach our audience? Access our media kit.

DISCOVER MORE FROM INFORMA TECH

  • IoT World Series
  • Channel Futures
  • RISC-V
  • Dark Reading
  • ITPro Today
  • Web Hosting Talk

WORKING WITH US

  • Contact
  • About Us
  • Advertise
  • Login/Register

FOLLOW IoT World Today ON SOCIAL

  • Privacy
  • CCPA: “Do Not Sell My Data”
  • Cookies Policy
  • Terms
Copyright © 2022 Informa PLC. Informa PLC is registered in England and Wales with company number 8860726 whose registered and Head office is 5 Howick Place, London, SW1P 1WG.
This website uses cookies, including third party ones, to allow for analysis of how people use our website in order to improve your experience and our services. By continuing to use our website, you agree to the use of such cookies. Click here for more information on our Cookie Policy and Privacy Policy.
X