Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Docker on IOT - Dockercon19 SFO Recap & Announcements, Bangalore

440 views

Published on

Presented today at Docker Bangalore Meetup at VISA Office

Published in: Technology
  • Be the first to comment

Docker on IOT - Dockercon19 SFO Recap & Announcements, Bangalore

  1. 1. Docker on IOT Dockercon19 SFO Recap & Announcements, Bangalore 15 Jun 2019
  2. 2. $Whoami Sangam Biradar Github-sangam14 Twitter-BiradarSangam $curl engineitops.icu - My Personal Blog Website - Over 100+ blog post on docker | Golang and kubernetes and cloud - Unique 10000+ hits - Research Papers Presented/Published in the Conference Proceedings(IEEE) 1.“Build Minimal Docker Container Using Golang’’- presented and published in the proceedings of the International Conference ICICCS2018 at Vaigai College Of Engineering, Madurai 14 June 18
  3. 3. Agenda - Why the IOT Needs Docker? - How to setup Docker Swarm Cluster on Raspberry Pi - Docker Container for Raspberry Pi to Blink an LED - Questions?
  4. 4. Why the IoT Needs Docker? - Minimal hardware resources. - Geographic distribution. - Limited or sporadic network access - Widely varying device environments.
  5. 5. How to setup Docker Swarm Cluster on Raspberry Pi?
  6. 6. Docker Container for Raspberry Pi to Blink an LED - Install Docker on Raspberry pi sudo apt-get update && sudo apt-get upgrade curl -sSL https://get.docker.com | sh sudo usermod -aG docker your-username
  7. 7. Prepare the Circuit:
  8. 8. Clone repo Git clone https://github.com/sangam14/Docker-IOT-rpi.git $ cd Docker-IOT-rpi Docker-IOT-rpi $ ls Dockerfile ledblinker.py readme.md
  9. 9. ledblinker.py
  10. 10. Dockerfile # Python Base Image from https://hub.docker.com/r/arm32v7/python/ FROM arm32v7/python:2.7.13-jessie # Copy the Python Script to blink LED COPY led_blinker.py ./ # Intall the rpi.gpio python module RUN pip install --no-cache-dir rpi.gpio # Trigger Python script CMD ["python", "./led_blinker.py"]
  11. 11. docker-build pi@raspberrypi:~/docker-ledblink $ docker build -t "docker_blinker:v1” . Sending build context to Docker daemon 3.072kB Step 1/4 : FROM arm32v7/python:2.7.13-jessie ---> fd232f7d5f5f Step 2/4 : COPY led_blinker.py ./ ---> Using cache ---> 2c20ac080696 Step 3/4 : RUN pip install --no-cache-dir rpi.gpio ---> Using cache ---> 1d7557012625 Step 4/4 : CMD ["python", "./led_blinker.py"] ---> Using cache ---> 856014f90903 Successfully built 856014f90903 Successfully tagged docker_blinker:v1
  12. 12. Run Container pi@raspberrypi:~/docker-ledblink $ docker container run -- device /dev/gpiomem -d docker_blinker:v1 OR docker container run --privileged -d docker_blinker:v1 Reference : https://github.com/raspberrypi/linux/pull/1112
  13. 13. Demo
  14. 14. You should see it successfully Running Cheers ! Stop container :- docker stop $(docker ps -a -q) https://github.com/collabnix/dockerlabs/blob/master/ beginners/install/raspberrypi3/Docker- IOT_Using_Arduino_Uno_and_Johnny-Five.md
  15. 15. Questions?
  16. 16. Thanks

×