DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Dockerizing Your Homemade IoT Christmas Light Controller

Dockerizing Your Homemade IoT Christmas Light Controller

What's better than making your own light controller? Making it into a Docker image. Follow along to learn how it's done.

Wilfred Nilsen user avatar by
Wilfred Nilsen
·
Nov. 17, 16 · Tutorial
Like (6)
Save
Tweet
Share
10.05K Views

Join the DZone community and get the full member experience.

Join For Free

In my previous article, I explained how to build your own IoT Christmas Light Controller by having Arduino Light Controller devices connect to an online server running on a VPS. After reading several really good Docker tutorials on DZone, I decided to Dockerize the IoT Light Controller server applications and make the application available as a Docker image. Docker is a project that automates the deployment of Linux applications inside software containers. You do not need to understand anything about Docker when following the installation sequence below. You can simply copy and paste the commands.

Light Controller Docker Image

Docker images can make deployment very easy and service providers could make it super easy to install a Docker image by simply providing a web form where you enter the Docker image name. However, Docker is still fairly new, thus most service providers require that you install the Docker image by using the command line. In this article, I'll show you how to install the Light Controller Docker image on the Google Cloud Platform and on Azure.

All service providers give you a free trial period, but Google also provides a free quota after the trial for low capacity web applications. The Light Controller is very resource light and should fit within the free quota allowed by Google.

Quoting Google:

Google App Engine has a free quota that applies regardless of whether you're in the free trial. This means you can run a web application at low traffic and capacity for free, both during and after the free trial.

Installing the Light Controller on the Google Cloud Platform

  1. Sign up for a trial account.

  2. After signing up, navigate to the Dashboard and click Create Project.

  3. After creating the project, click the "Activate Google Cloud Shell" button to open the web based shell.

  4. Paste the following commands into the web shell:

    gcloud config set compute/zone us-central1-b
    gcloud container clusters create --num-nodes=1 light-controller
    kubectl run light-controller --image=rtld/light-controller --port=80
    kubectl expose deployment light-controller --type="LoadBalancer"
  5. When the commands complete, wait one minute and run the following command to get the public IP address:

    kubectl get service light-controller
  6. Enter the IP address (from step 5) in your browser and navigate to the Light Controller

  7. Set the Light Controller admin credentials

The following two-minute video shows the complete installation procedure.


Installing the Light Controller on Azure

  1. Sign up for a trial: https://azure.microsoft.com/en-us/free/

  2. After signup, navigate to: https://github.com/Azure/azure-quickstart-templates/tree/master/docker-simple-on-ubuntu

  3. Click Deploy to Azure.

  4. Configure credentials (you need the credentials later when using SSH).

  5. Wait for the process to complete.

  6. Click MyDockerVM in the control panel.

  7. Take note of the IP address.

  8. Use an SSH client such as putty and connect as: username@ip-address

  9. Login using the password you set in step 4.

  10. Run the command:  sudo docker run -d -p 80:80 rtld/light-controller 

  11. When the command has completed, use a browser and navigate to http://ip-address

Light (web browser) Docker (software) IoT application Google (verb) Command (computing) Web Service Google App Engine Web application Cloud

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Container Security: Don't Let Your Guard Down
  • Unlocking the Power of Elasticsearch: A Comprehensive Guide to Complex Search Use Cases
  • Steel Threads Are a Technique That Will Make You a Better Engineer
  • Building a Real-Time App With Spring Boot, Cassandra, Pulsar, React, and Hilla

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: