https://www.iotworldtoday.com/wp-content/themes/ioti_child/assets/images/logo/footer-logo.png
  • Home
  • News
    • Back
    • IoT World 2020 News
  • Strategy
  • Special Reports
  • Galleries
  • Business Resources
    • Back
    • Webinars
    • White Papers
    • Industry Perspectives
    • Featured Vendors
  • Other Content
    • Back
    • IoT World 2020 News
    • Q&As
    • Case Studies
    • Features
    • How-to
    • Opinion
    • Video / Podcasts
  • More
    • Back
    • About Us
    • Contact
    • Advertise
    • Strategic Partners
  • IOT World Events
    • Back
    • Internet of Things World: San Jose
    • IoT World 2020 News
Iot World Today
  • NEWSLETTER
  • Home
  • News
    • Back
    • IoT World 2020 News
  • Strategy
  • Special Reports
  • Galleries
  • Business Resources
    • Back
    • Webinars
    • White Papers
    • Industry Perspectives
    • Featured Vendors
  • Other Content
    • Back
    • IoT World 2020 News
    • Q&As
    • Case Studies
    • Features
    • How-to
    • Opinion
    • Video / Podcasts
  • More
    • Back
    • About Us
    • Contact
    • Advertise
    • Strategic Partners
  • IOT World Events
    • Back
    • Internet of Things World: San Jose
    • IoT World 2020 News
  • newsletter
  • IIoT
  • Cities
  • Energy
  • Homes/Buildings
  • Transportation/Logistics
  • Connected Health Care
  • Retail
  • AI
  • Architecture
  • Engineering/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


  • Training and Development on the Mechanism of Metal Gears. in the design of information related to business
    Turning to Rust Development For IoT Performance
    If you haven’t heard of it, Rust is an up-and-coming programming language that provides secure application performance for device-run code.
  • Jetting to the Stars Using Containers for Development
    The Department of Defense develops for space travel, bombers and jets. It turned to containers for development to build and battle-test its mission-critical systems.
  • ‘Edge NLP’ Is About Doing More With Less
    Digital assistants, enabled by natural language processing can execute a range of functions. But 'edge NLP,' has little use when embedded in devices with limited resources and connectivity.
  • Network Connectivity Paves Way, with Caveats, for IoT Adoption
    Respondents to an IoT adoption survey said that network connectivity options, including 5G, will enable projects. But there are hurdles in the quest for better network performance.

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

  • State of Manufacturing Technology Report
  • Modernizing the Manufacturing Industry with MQTT
  • Enabling the Connected Car with MQTT and HiveMQ
  • Smart Grid Security Will Get Boost from AI and 5G

News

View all

Private LTE Market Projected to Grow to $13 Billion

12th January 2021

IoT World Announces 2021 IoT World Advisory Board

9th December 2020

White Papers

View all

The eSIM Cookbook – Towards the Next Generation of Connected Devices

22nd February 2021

eSIM Delivers Greater Freedom for OEMs – by Beecham Research and Truphone

22nd February 2021

Special Reports

View all

Cybersecurity Protection Increasingly Depends on Machine Learning

28th October 2020

Webinars

View all

Weber’s Journey: How a Top Grill Maker Serves Up Connected Cooking

25th February 2021

From Insights to Action: Best Practices for Implementing Connected Device Security

15th December 2020

Galleries

View all

Top IoT Trends to Watch in 2020

26th January 2020

Five of the Most Promising Digital Health Technologies

14th January 2020

Industry Perspectives

View all

IoT Spending Holds Firm — Tempered by Dose of ‘IoT Pragmatism’

1st December 2020

The Great IoT Connectivity Lockdown

11th May 2020

Events

View all

IoT at the Edge

17th March 2021

Embedded IoT World 2021

28th April 2021 - 29th April 2021

IoT World 2021

2nd November 2021 - 4th November 2021

Twitter

IoTWorldToday, IoTWorldSeries

🎙️ Introducing #EIOTWORLD speaker, Obinna Ilochonwu, Industrial IoT Architect at Schlumberger. 📅 Join his session… twitter.com/i/web/status/1…

2nd March 2021
IoTWorldToday, IoTWorldSeries

#Smartbuilding technology lays the foundation for #energyefficiency efforts but also new COVID-19 goals, such as… twitter.com/i/web/status/1…

2nd March 2021
IoTWorldToday, IoTWorldSeries

IoT Remote Monitoring Helps Enterprises Traverse COVID-19 and Beyond dlvr.it/RtZ3K5 https://t.co/owJXYf1gkO

26th February 2021
IoTWorldToday, IoTWorldSeries

Securing the Industrial Internet of Things dlvr.it/RtYfYk https://t.co/khUn79dvQD

26th February 2021
IoTWorldToday, IoTWorldSeries

📢 Announcing #EIOTWORLD sponsor, @BluetoothSIG — the global standard for simple, secure wireless connections. ➕ Le… twitter.com/i/web/status/1…

26th February 2021
IoTWorldToday, IoTWorldSeries

How IoT Devices Can Enhance the Connected Customer Experience dlvr.it/RtPcvS

24th February 2021
IoTWorldToday, IoTWorldSeries

🤝 Meet #EIOTWORLD speaker Ingo Feldner, Project Lead for Virtual #Hardware Platforms at @RobertBoschGmbH 📅 Join hi… twitter.com/i/web/status/1…

24th February 2021
IoTWorldToday, IoTWorldSeries

Developing IoT Applications with Rust: Using a Rust Development Environment dlvr.it/RtNqrk https://t.co/wOmnoz2UVT

24th February 2021

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 © 2021 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