Azure IoT Edge Part 1: Preparing Environment with Bash
Recently, the SPR Milwaukee team sponsored THAT Conference in Wisconsin Dells. We also shared thought leadership during a speaking session, discussing Azure IoT Edge as a tool for deploying an intelligent edge in an Internet of Things software solution. This topic proved to be valuable to others beginning their own journey to an intelligent edge.
Throughout this four-part series, I will share how to set up a container using Bash to emulate Azure IoT Edge installed and running on Ubuntu using the Azure CLI for automation. Here’s what we’re trying to accomplish:
If you are using an operating system with Bash, the upcoming posts should work as long as Docker is installed and configured. If you are using Windows, the first part of this process is to install Windows Subsystem for Linux.
- Open PowerShell as Administrator and enable Windows Subsystem for Linux using the following command
- Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Next, install Ubuntu from the Microsoft Store
- Install Docker for Windows following the instructions on the Docker website
- After installing Docker, we need to make it available to our Ubuntu installation. Enable the Docker Remote API by going to the settings and checking the box labeled “Expose daemon on tcp://localhost:2375 without TLS”. This allows Ubuntu to use the Docker for Windows installation.
Ubuntu Environment Setup
- Install the packages needed to use a repository over HTTPS using the following command:
- sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- Add the Docker GPG key
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
- Set up the repository to use Ubuntu in a Docker container
- sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
- Install Docker CE
- sudo apt-get install docker-ce
- Finally, one last command to tell Ubuntu how to connect to Docker for Windows
- echo “export DOCKER_HOST=localhost:2375” >> ~/.bash_profile
Now, your machine has been prepared to use Windows Subsystem for Linux. This will enable the next step for a generic container on Ubuntu running Azure IoT Edge. Upcoming parts in the series:
- Azure IoT Edge Part 2: Configuring the Docker Container
- Azure IoT Edge Part 3: Configuring the Docker Container with the Azure CLI
- Azure IoT Edge Part 4: Configuring Deployment to Azure IoT Edge