Deploying Containers
on Heterogeneous IoT
Devices
Daniel Bruzual
Researcher at
Aalto University
what it is and
why it matters
IoT and Fog
Computing
• Distributed
applications
• Provisioning
• Networking
Docker Swarm
• Heterogeneous
○ Host OS
○ Architecture
○ Sensors
• Resource-constrained
IoT Devices
• Leader:
docker swarm init
• Copy tokens:
docker swarm join-token worker
• Other nodes:
docker swarm join -token <token> <IP:PORT>
Creating a Swarm
Business as usual
• Server with swarm description
• Startup container → pull config
• Init swarm → store tokens
• Join swarm
Reference scenario: plug and play
Provisioning
Bootstrapping a swarm
• Leave out the clutter
• Limited storage
• Save bandwidth
Compact Images
Multi-stage builds
FROM golang:1.8 as build
WORKDIR /go/src/humidity-sensor
COPY main.go ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo 
-ldflags '-extldflags "-static"' -installsuffix cgo -o app .
FROM scratch
COPY --from=build /go/src/humidity-sensor/app /humidity
COPY --from=build /etc/ssl/certs/ /etc/ssl/certs
CMD ["/humidity"]
Multi-Stage Dockerfile
• Multiple images under single name
• Supported by Docker Swarm
• Abstract host heterogeneity
Reference scenario: different models of weather station
Multiple Architectures
Fat manifests
• Node labels
• Placement constraints
• Networks
Deploy Applications
dan@farm $ docker service create 
--constraint ‘node.labels.device==thermometer’ 
--mode global temp-monitor 
temp-monitor
Deploy Applications
device = thermometer
model = DS18B20
device = sprinkler
• --device /dev/*
(SwarmKit #1244)
• Secure provisioning
Future Work
Check out
• Phil Estes C0 14:00
• hypriot.com
• blog.alexellis.io
• blog.resin.io
Thank You!
Find me on Hallway track!
@danbruzual
#dockercon

Deploying containers on Heterogeneous IOT devices by Daniel Bruzual

  • 1.
    Deploying Containers on HeterogeneousIoT Devices Daniel Bruzual Researcher at Aalto University
  • 2.
    what it isand why it matters IoT and Fog Computing
  • 7.
  • 8.
    • Heterogeneous ○ HostOS ○ Architecture ○ Sensors • Resource-constrained IoT Devices
  • 9.
    • Leader: docker swarminit • Copy tokens: docker swarm join-token worker • Other nodes: docker swarm join -token <token> <IP:PORT> Creating a Swarm Business as usual
  • 10.
    • Server withswarm description • Startup container → pull config • Init swarm → store tokens • Join swarm Reference scenario: plug and play Provisioning Bootstrapping a swarm
  • 11.
    • Leave outthe clutter • Limited storage • Save bandwidth Compact Images Multi-stage builds
  • 12.
    FROM golang:1.8 asbuild WORKDIR /go/src/humidity-sensor COPY main.go ./ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-extldflags "-static"' -installsuffix cgo -o app . FROM scratch COPY --from=build /go/src/humidity-sensor/app /humidity COPY --from=build /etc/ssl/certs/ /etc/ssl/certs CMD ["/humidity"] Multi-Stage Dockerfile
  • 13.
    • Multiple imagesunder single name • Supported by Docker Swarm • Abstract host heterogeneity Reference scenario: different models of weather station Multiple Architectures Fat manifests
  • 14.
    • Node labels •Placement constraints • Networks Deploy Applications
  • 15.
    dan@farm $ dockerservice create --constraint ‘node.labels.device==thermometer’ --mode global temp-monitor temp-monitor Deploy Applications device = thermometer model = DS18B20 device = sprinkler
  • 16.
    • --device /dev/* (SwarmKit#1244) • Secure provisioning Future Work Check out • Phil Estes C0 14:00 • hypriot.com • blog.alexellis.io • blog.resin.io
  • 17.
    Thank You! Find meon Hallway track! @danbruzual #dockercon