This slides describe how to put Docker on Internet of Things (IoT) especially Raspberry Pi 2. Describing 2 options Hypriot and Ubuntu 15.10 MATE and challenges for using Docker on Raspberry Pi 2.
2. In this hour …
• Internet of Things
• What is IoT?
• IoT Services?
• Docker
• What is Docker?
• Docker CLI
• Dockerfile
• Raspberry Pi 2
• Board
• Operating System
• Where to buy?
• Docker on Raspberry Pi 2
• Current OS
• Dockerizing …
• Demo
4. What is Internet of Things (IoT)?
• The Internet of Things (IoT) is the network of physical objects
or "things" embedded with electronics, software, sensors, and
network connectivity, which enables these objects to collect
and exchange data.
https://en.wikipedia.org/wiki/Internet_of_Things
5. Billions of Things Connected to
Internet by 2020
• The estimated 26 billion units to be installed within the
Internet of Things by 2020, according to Gartner, Inc., do not
include PCs, tablets and smartphones.
• Cisco and Intel estimate 50 billion connected devices by 2020.
11. What is Docker?
• Docker is an open platform for building, shipping and running
distributed applications. It gives programmers, development
teams and operations engineers the common toolbox they
need to take advantage of the distributed and networked
nature of modern applications.
http://www.docker.com
12. Docker Containers
• Docker containers wrap up a piece of
software in a complete filesystem
that contains everything it needs to
run: code, runtime, system tools,
system libraries – anything you can
install on a server. This guarantees
that it will always run the same,
regardless of the environment it is
running in.
13. Docker Containers = Lightweight
• Containers running on a single machine all share the same
operating system kernel so they start instantly and make more
efficient use of RAM.
• Images are constructed from layered filesystems so they can
share common files, making disk usage and image downloads
much more efficient.
15. Docker CLI
• docker build # Build an image from a Dockerfile
• docker images # List all images on a Docker host
• docker run # Run an image
• docker ps # List all running and stopped instances
• docker stop # Stop a running instances
• docker rm # Remove an instance
• docker rmi # Remove an image
• docker stats # Show running containers‘ resource usage info
• docker attach # Attach to a running container
• docker logs # Fetch the logs of a container
• docker inspect # Return low-level information on a container or image
16. Dockerfile
• Dockerfiles = image representations
• Simple syntax for building images
• Automate and script the images creation
18. Board …
• The Raspberry Pi 2 is a
low cost, credit-card
sized computer that
plugs into a computer
monitor or TV, and uses
a standard keyboard
and mouse.
19. Raspberry Pi 2 (RPi2)
• RPi2 – 2nd generation of Raspberry Pi.
• A 900MHz quad-core ARM Cortex-A7 CPU
• 1GB RAM
• 4 USB ports
• 40 GPIO pins
• Full HDMI port
• Ethernet port
• Combined 3.5mm audio jack and composite video
• Camera interface (CSI)
• Display interface (DSI)
• Micro SD card slot
• VideoCore IV 3D graphics core
20. Operating Systems for RPi2
• Because it has an ARMv7 processor, it can run the full range of
ARM GNU/Linux distributions, including Snappy Ubuntu Core,
as well as Microsoft Windows 10.
and more to come …
21. Where to buy? In Malaysia?
OR just ask Uncle
* The presenter is not associate/affliate with any of them!!!
26. Hypriot
Hypriot had a short
demo session on the
second day of the
DockerCon 2015 in San
Francisco,CA (USA). The
goal of the demo was
to show that Docker is
a really lightweight
“virtualization”
solution that can be
easily run on small IoT
devices.
27. Option 2: Ubuntu 15.10 Mate for RPi2
https://ubuntu-mate.org/raspberry-pi/
28. Dockerizing ………… WAIT!!!
• Docker images are the basis of containers.
• Docker images are available from Docker Hub Registry.
• RPi2 = platform armhf.
• Build your own images
• Pull images from Docker Hub Registry.
29. Challenges … (1)
• Most of Docker images from Docker Hub Registry are
packaged for x86/x64.
• You have to build the required Docker image if no image
available in Docker Hub Registry.
• Docker-based apps packaged for x86/x64 will not work and
will result in an error such:
30. Challenges … (2)
• Limited number of packages on armhf platform.
• Ubuntu MATE also provide packages management for use with
RPi2 (easy for Ubuntu fans).
• Use apt-get install within RPi2 running Ubuntu MATE 15.10
31. Challenges … (3)
• Private Registry vs Public Registry
• The Registry is a stateless, highly scalable server side
application that stores and lets you distribute Docker images.
• Private Registry: tightly control where your images are being
stored, fully own your images distribution pipeline, integrate
image storage and distribution tightly into your in-house
development workflow.
• Public Registry: zero maintenance, ready-to-go, free-to-use,
hosted Registry by Docker Hub and plus additional features.
32. Now … We can start Dockerizing …
• Easy jumpstart:
• 1) Hypriot ( http://blog.hypriot.com/getting-started-with-
docker-on-your-arm-device/ )
• 2) Ubuntu 15.10 MATE for RPi2 ( https://ubuntu-
mate.org/raspberry-pi )
33. Hypriot Way …
Hypriot (http://blog.hypriot.com/downloads/ )
1) Download latest RPi2 images
2) Flash/burn the image to MicroSD card (min:8GB, class 10)
3) Ready to go
34. Ubuntu Way …
Ubuntu 15.10 MATE for RPi2 (https://ubuntu-
mate.org/raspberry-pi/ )
1) Download latest RPi2 images
2) Flash/burn the image to MicroSD card (min:8GB, class 10)
3) Ready to go
35. Docker CLI … again …
• docker build # Build an image from a Dockerfile
• docker images # List all images on a Docker host
• docker run # Run an image
• docker ps # List all running and stopped instances
• docker stop # Stop a running instances
• docker rm # Remove an instance
• docker rmi # Remove an image
• docker stats # Show running containers‘ resource usage info
• docker attach # Attach to a running container
• docker logs # Fetch the logs of a container
• docker inspect # Return low-level information on a container or image
36. Dockerfile … again …
Dockerfile Reference:
https://docs.docker.com/engine/reference/build
er/
FROM MAINTAINER ADD COPY EXPOSE
ENV EXPOSE LABEL USER CMD
WORKDIR VOLUME STOPSIGNAL RUN
ENTRYPOINT