Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker on ARM

Docker on ARM

DevOps CodeLabs
Docker on ARM Boards - HypriotOS
http://eueung.github.io/docker-stuff/hypriot

Eueung Mulyana

May 06, 2016
Tweet

More Decks by Eueung Mulyana

Other Decks in Technology

Transcript

  1. Team Hypriot - Goals Containers and the Internet of Things

    evangelizing to use Docker container on ARM boards convincing Docker containers for IoT applications enabling the Docker ecosystem on low-powered devices Pushing the Docker technology into the IoT world "Since we started in early 2015 our mission was to make container technology a rst class citizen on ARM and IoT devices. Then and now Docker was the dominant container technology so it made sense to concentrate on Docker" 4 / 29 Ref: Dieter Reuter, Hypriot
  2. Main Features minimal Debian-based operating system - most people know

    how to use Debian & Ubuntu based distros optimized for Docker awesomeness - from optimized and tuned Linux kernel settings to the included leystems everything is aligned to make Docker run very well up-to-date Docker versions - often we are only mere seconds behind the o cially published upstream versions really easy to use - download, ash and boot - that's all you need to get started 5 / 29 HypriotOS A minimal Debian-based operating systems that is optimized to run Docker First Release 02/2014 Ref: About HypriotOS
  3. 6 / 29 Concepts - Parts and Ideas The New

    HypriotOS A Debian-based root lesystem (32 and 64-bit) A board speci c layer: Linux kernel, rmware, bootloader A common layer: Hypriot speci c settings and tools, Docker Engine, Compose, Swarm, Machine An optional application layer e.g. Hypriot Cluster Lab
  4. $ s u d o a p t i n

    s t a l l p v a w s c l i $ s u d o a p t i n s t a l l n m a p # a w s c l i m i g h t n o t b e n e c e s s a r y $ w g e t h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / h y p r i o t / f l a s h / m a s t e r / $ c h m o d + x f l a s h $ s u d o m v f l a s h / u s r / l o c a l / b i n / f l a s h $ f l a s h - - h o s t n a m e n o d e 2 h y p r i o t - r p i - 2 0 1 6 0 3 0 6 - 1 9 2 3 1 7 . i m g # m m c b l k 0 # o r f l a s h h t t p : / / d o w n l o a d s . h y p r i o t . c o m / h y p r i o t - r p i - 2 0 1 6 0 3 0 6 - 1 # o r u s i n g d d # u m o u n t . . . # s u d o d d i f = h y p r i o t . i m g o f = / d e v / m m c b l k 0 b s = 1 M # u m o u n t . . . $ l s b l k N A M E M A J : M I N R M S I Z E R O T Y P E M O U N T P O I N T s d a 8 : 0 0 4 6 5 , 8 G 0 d i s k s d a 1 8 : 1 0 4 4 9 , 9 G 0 p a r t / s d a 2 8 : 2 0 1 K 0 p a r t s d a 5 8 : 5 0 1 5 , 9 G 0 p a r t [ S W A P ] s r 0 1 1 : 0 1 1 0 2 4 M 0 r o m m m c b l k 0 1 7 9 : 0 0 1 4 , 9 G 0 d i s k m m c b l k 0 p 1 1 7 9 : 1 0 6 0 M 0 p a r t / m e d i a / e m / b o o t m m c b l k 0 p 2 1 7 9 : 2 0 1 4 , 9 G 0 p a r t / m e d i a / e m / e 6 e 7 f 7 7 6 - . . . 10 / 29 Step #1 Prepare & Flash
  5. $ p i n g n o d e 2

    . l o c a l P I N G n o d e 2 . l o c a l ( 1 9 2 . 1 6 8 . 1 . 1 0 0 ) 5 6 ( 8 4 ) b y t e s o f d a t a . 6 4 b y t e s f r o m 1 9 2 . 1 6 8 . 1 . 1 0 0 : i c m p _ s e q = 1 t t l = 6 4 t i m e = 6 . 4 4 m s 6 4 b y t e s f r o m 1 9 2 . 1 6 8 . 1 . 1 0 0 : i c m p _ s e q = 2 t t l = 6 4 t i m e = 1 . 9 6 m s . . . $ s s h r o o t @ n o d e 2 . l o c a l T h e a u t h e n t i c i t y o f h o s t ' n o d e 2 . l o c a l ( 1 9 2 . 1 6 8 . 1 . 1 0 0 ) ' c a n ' t b E C D S A k e y f i n g e r p r i n t i s S H A 2 5 6 : t N r d O c X b 8 t z u E W c C 9 y J N S P 1 c 5 1 l + 7 f A r e y o u s u r e y o u w a n t t o c o n t i n u e c o n n e c t i n g ( y e s / n o ) ? y e s W a r n i n g : P e r m a n e n t l y a d d e d ' n o d e 2 . l o c a l , 1 9 2 . 1 6 8 . 1 . 1 0 0 ' ( E C D S A ) r o o t @ n o d e 2 . l o c a l ' s p a s s w o r d : T h e p r o g r a m s i n c l u d e d w i t h t h e D e b i a n G N U / L i n u x s y s t e m a r e f r e t h e e x a c t d i s t r i b u t i o n t e r m s f o r e a c h p r o g r a m a r e d e s c r i b e d i n d i v i d u a l f i l e s i n / u s r / s h a r e / d o c / * / c o p y r i g h t . D e b i a n G N U / L i n u x c o m e s w i t h A B S O L U T E L Y N O W A R R A N T Y , t o t h e e x t p e r m i t t e d b y a p p l i c a b l e l a w . H y p r i o t O S : r o o t @ n o d e 2 i n ~ $ # C r e d s : r o o t / h y p r i o t o r p i / r a s p b e r r y 11 / 29 Step #2 Switch-On & Connect
  6. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ h o s t n a m e c t l S t a t i c h o s t n a m e : n o d e 2 I c o n n a m e : c o m p u t e r C h a s s i s : n / a M a c h i n e I D : f 2 b c b 4 a 3 1 8 f 1 4 a 0 4 9 f 7 a 3 6 1 8 d 9 c 4 7 1 c 8 B o o t I D : 3 9 9 c f 2 0 c 9 9 6 d 4 6 c 4 b f 0 3 4 2 a a 6 b b a a 7 3 9 O p e r a t i n g S y s t e m : R a s p b i a n G N U / L i n u x 8 ( j e s s i e ) K e r n e l : L i n u x 4 . 1 . 1 7 - h y p r i o t o s - v 7 + A r c h i t e c t u r e : a r m $ c a t / e t c / o s - r e l e a s e P R E T T Y _ N A M E = " R a s p b i a n G N U / L i n u x 8 ( j e s s i e ) " N A M E = " R a s p b i a n G N U / L i n u x " V E R S I O N _ I D = " 8 " V E R S I O N = " 8 ( j e s s i e ) " I D = r a s p b i a n I D _ L I K E = d e b i a n H O M E _ U R L = " h t t p : / / w w w . r a s p b i a n . o r g / " S U P P O R T _ U R L = " h t t p : / / w w w . r a s p b i a n . o r g / R a s p b i a n F o r u m s " B U G _ R E P O R T _ U R L = " h t t p : / / w w w . r a s p b i a n . o r g / R a s p b i a n B u g s " 12 / 29 Step #3 Explore - General
  7. $ d o c k e r v e r

    s i o n C l i e n t : V e r s i o n : 1 . 1 0 . 2 A P I v e r s i o n : 1 . 2 2 G o v e r s i o n : g o 1 . 4 . 3 G i t c o m m i t : c 3 9 5 9 b 1 B u i l t : W e d F e b 2 4 0 9 : 5 1 : 3 8 2 0 1 6 O S / A r c h : l i n u x / a r m S e r v e r : V e r s i o n : 1 . 1 0 . 2 A P I v e r s i o n : 1 . 2 2 G o v e r s i o n : g o 1 . 4 . 3 G i t c o m m i t : c 3 9 5 9 b 1 B u i l t : W e d F e b 2 4 0 9 : 5 1 : 3 8 2 0 1 6 O S / A r c h : l i n u x / a r m $ d o c k e r - c o m p o s e v e r s i o n d o c k e r - c o m p o s e v e r s i o n 1 . 6 . 2 , b u i l d 4 d 7 2 0 2 7 d o c k e r - p y v e r s i o n : 1 . 7 . 2 C P y t h o n v e r s i o n : 2 . 7 . 9 O p e n S S L v e r s i o n : O p e n S S L 1 . 0 . 1 k 8 J a n 2 0 1 5 $ d o c k e r - m a c h i n e - - v e r s i o n d o c k e r - m a c h i n e v e r s i o n 0 . 4 . 1 ( 5 4 9 d 0 1 6 ) 13 / 29 Step #4 Explore - Docker Stuff
  8. $ d o c k e r i n f

    o C o n t a i n e r s : 0 R u n n i n g : 0 P a u s e d : 0 S t o p p e d : 0 I m a g e s : 2 S e r v e r V e r s i o n : 1 . 1 0 . 2 S t o r a g e D r i v e r : o v e r l a y B a c k i n g F i l e s y s t e m : e x t f s E x e c u t i o n D r i v e r : n a t i v e - 0 . 2 L o g g i n g D r i v e r : j s o n - f i l e P l u g i n s : V o l u m e : l o c a l N e t w o r k : b r i d g e n u l l h o s t K e r n e l V e r s i o n : 4 . 1 . 1 7 - h y p r i o t o s - v 7 + O p e r a t i n g S y s t e m : R a s p b i a n G N U / L i n u x 8 ( j e s s i e ) O S T y p e : l i n u x A r c h i t e c t u r e : a r m v 7 l C P U s : 4 T o t a l M e m o r y : 9 2 5 . 5 M i B N a m e : n o d e 2 I D : H X 6 D : Z A U S : R C V C : O A 6 Y : N T U 6 : K J 2 P : K U I F : B E 6 Q : A N I X : U 3 N E : C M D O : T C H D e b u g m o d e ( s e r v e r ) : t r u e F i l e D e s c r i p t o r s : 1 1 G o r o u t i n e s : 2 0 S y s t e m T i m e : 2 0 1 6 - 0 4 - 2 8 T 1 2 : 1 7 : 1 4 . 5 4 0 7 5 8 7 6 4 + 0 2 : 0 0 E v e n t s L i s t e n e r s : 0 I n i t S H A 1 : d f e b 8 c 1 7 f 8 c 3 a 1 1 8 7 5 3 f e a 8 3 5 3 b 7 1 5 a 7 a 7 5 f 5 4 9 1 I n i t P a t h : / u s r / l i b / d o c k e r / d o c k e r i n i t D o c k e r R o o t D i r : / v a r / l i b / d o c k e r 14 / 29 Step #4 Explore - Docker Stuff
  9. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ d o c k e r p u l l h y p r i o t / r p i - b u s y b o x - h t t p d U s i n g d e f a u l t t a g : l a t e s t l a t e s t : P u l l i n g f r o m h y p r i o t / r p i - b u s y b o x - h t t p d c 7 4 a 9 c 6 a 6 4 5 f : P u l l c o m p l e t e 6 f 1 9 3 8 f 6 d 8 a e : P u l l c o m p l e t e e 1 3 4 7 d 4 7 4 7 a 6 : P u l l c o m p l e t e a 3 e d 9 5 c a e b 0 2 : P u l l c o m p l e t e D i g e s t : s h a 2 5 6 : c 0 0 3 4 2 f 9 5 2 d 9 7 6 2 8 b f 5 d d a 4 5 7 d 3 b 4 0 9 c 3 7 d f 6 8 7 c 8 5 9 d f 8 2 S t a t u s : D o w n l o a d e d n e w e r i m a g e f o r h y p r i o t / r p i - b u s y b o x - h t t p d : l H y p r i o t O S : r o o t @ n o d e 2 i n ~ $ d o c k e r i m a g e s R E P O S I T O R Y T A G I M A G E I D h y p r i o t / r p i - s w a r m l a t e s t c 2 9 8 d e 0 6 2 1 9 0 h y p r i o t / r p i - b u s y b o x - h t t p d l a t e s t f b d 9 6 8 5 c 5 f f c $ d o c k e r r u n - d - p 8 0 : 8 0 h y p r i o t / r p i - b u s y b o x - h t t p d e a b 9 2 6 d 8 4 2 a b 7 b 3 3 4 8 1 0 5 1 7 f d 5 e 4 5 7 4 6 8 3 4 9 4 d 1 b b 8 2 b c f 4 2 d a b d 8 c 1 0 7 e 7 f b c H y p r i o t O S : r o o t @ n o d e 2 i n ~ $ d o c k e r p s C O N T A I N E R I D I M A G E C O M M A N D e a b 9 2 6 d 8 4 2 a b h y p r i o t / r p i - b u s y b o x - h t t p d " / b i n / b u s y b o x 15 / 29 Step #5 Try - Hypriot World
  10. $ d o c k e r b u i

    l d - t j a n c e l i n / r p i - m o n i t o r g i t : / / g i t h u b . c o m / j a n c e l $ d o c k e r i m a g e s R E P O S I T O R Y T A G I M A G E I D j a n c e l i n / r p i - m o n i t o r l a t e s t 6 e 7 0 c 4 8 2 c 2 a 2 h y p r i o t / r p i - s w a r m l a t e s t c 2 9 8 d e 0 6 2 1 9 0 h y p r i o t / r p i - b u s y b o x - h t t p d l a t e s t f b d 9 6 8 5 c 5 f f c $ d o c k e r r u n - p 8 8 8 8 : 8 8 8 8 - p 4 2 0 0 : 4 2 0 0 - d - t j a n c e l i n / r p i - m o n i 17 / 29 Step #5 Another Try - RPI Monitor
  11. $ d o c k e r p u l

    l h y p r i o t / r p i - g p i o U s i n g d e f a u l t t a g : l a t e s t l a t e s t : P u l l i n g f r o m h y p r i o t / r p i - g p i o 8 e 7 8 7 5 c f a b 3 7 : P u l l c o m p l e t e 6 9 5 3 5 5 7 b 7 8 3 2 : P u l l c o m p l e t e D i g e s t : s h a 2 5 6 : 4 0 5 5 a 3 9 a 2 b 6 8 4 0 4 c 0 a c 9 5 1 6 b 5 4 4 0 d 1 0 3 e 5 2 e b 7 1 1 b 5 3 e 7 8 6 S t a t u s : D o w n l o a d e d n e w e r i m a g e f o r h y p r i o t / r p i - g p i o : l a t e s t H y p r i o t O S : r o o t @ n o d e 2 i n ~ $ d o c k e r i m a g e s R E P O S I T O R Y T A G I M A G E I D h y p r i o t / r p i - s w a r m l a t e s t c 2 9 8 d e 0 6 2 1 9 0 h y p r i o t / r p i - b u s y b o x - h t t p d l a t e s t f b d 9 6 8 5 c 5 f f c h y p r i o t / r p i - g p i o l a t e s t b 3 5 a 4 4 6 9 5 f d 0 20 / 29 Pull Image hypriot/rpi-gpio ... the binary from the wiringPi project within a Docker container
  12. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ d o c k e r r u n - - r m - - c a p - a d d S Y S _ R A W I O - - d e v i c e / d e v / m e m h y p r i o t / r p i - g p i o r e a d a l l + - - - - - + - - - - - + - - - - - - - - - + - - - - - - + - - - + - - - P i 2 - - - + - - - + - - - - - - + - - - - - - - - - + - - - - - + - - - - - + | B C M | w P i | N a m e | M o d e | V | P h y s i c a l | V | M o d e | N a m e | w P i | B C M | + - - - - - + - - - - - + - - - - - - - - - + - - - - - - + - - - + - - - - + + - - - - + - - - + - - - - - - + - - - - - - - - - + - - - - - + - - - - - + | | | 3 . 3 v | | | 1 | | 2 | | | 5 v | | | | 2 | 8 | S D A . 1 | I N | 1 | 3 | | 4 | | | 5 V | | | | 3 | 9 | S C L . 1 | I N | 1 | 5 | | 6 | | | 0 v | | | | 4 | 7 | G P I O . 7 | I N | 1 | 7 | | 8 | 1 | A L T 0 | T x D | 1 5 | 1 4 | | | | 0 v | | | 9 | | 1 0 | 1 | A L T 0 | R x D | 1 6 | 1 5 | | 1 7 | 0 | G P I O . 0 | I N | 0 | 1 1 | | 1 2 | 0 | I N | G P I O . 1 | 1 | 1 8 | | 2 7 | 2 | G P I O . 2 | I N | 0 | 1 3 | | 1 4 | | | 0 v | | | | 2 2 | 3 | G P I O . 3 | I N | 0 | 1 5 | | 1 6 | 0 | I N | G P I O . 4 | 4 | 2 3 | | | | 3 . 3 v | | | 1 7 | | 1 8 | 0 | I N | G P I O . 5 | 5 | 2 4 | | 1 0 | 1 2 | M O S I | I N | 0 | 1 9 | | 2 0 | | | 0 v | | | | 9 | 1 3 | M I S O | I N | 0 | 2 1 | | 2 2 | 0 | I N | G P I O . 6 | 6 | 2 5 | | 1 1 | 1 4 | S C L K | I N | 0 | 2 3 | | 2 4 | 1 | I N | C E 0 | 1 0 | 8 | | | | 0 v | | | 2 5 | | 2 6 | 1 | I N | C E 1 | 1 1 | 7 | | 0 | 3 0 | S D A . 0 | I N | 1 | 2 7 | | 2 8 | 1 | I N | S C L . 0 | 3 1 | 1 | | 5 | 2 1 | G P I O . 2 1 | I N | 1 | 2 9 | | 3 0 | | | 0 v | | | | 6 | 2 2 | G P I O . 2 2 | I N | 1 | 3 1 | | 3 2 | 0 | I N | G P I O . 2 6 | 2 6 | 1 2 | | 1 3 | 2 3 | G P I O . 2 3 | I N | 0 | 3 3 | | 3 4 | | | 0 v | | | | 1 9 | 2 4 | G P I O . 2 4 | I N | 0 | 3 5 | | 3 6 | 0 | I N | G P I O . 2 7 | 2 7 | 1 6 | | 2 6 | 2 5 | G P I O . 2 5 | I N | 0 | 3 7 | | 3 8 | 0 | I N | G P I O . 2 8 | 2 8 | 2 0 | | | | 0 v | | | 3 9 | | 4 0 | 0 | I N | G P I O . 2 9 | 2 9 | 2 1 | + - - - - - + - - - - - + - - - - - - - - - + - - - - - - + - - - + - - - - + + - - - - + - - - + - - - - - - + - - - - - - - - - + - - - - - + - - - - - + | B C M | w P i | N a m e | M o d e | V | P h y s i c a l | V | M o d e | N a m e | w P i | B C M | + - - - - - + - - - - - + - - - - - - - - - + - - - - - - + - - - + - - - P i 2 - - - + - - - + - - - - - - + - - - - - - - - - + - - - - - + - - - - - + 22 / 29 GPIO readall
  13. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ d o c k e r r u n - - r m - - c a p - a d d S Y S _ R A W I O - - d e v i c e / d e v / m e m h y p r i o t / r p i - g p i o w r i t e 0 o n 23 / 29
  14. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ d o c k e r r u n - - r m - - c a p - a d d S Y S _ R A W I O - - d e v i c e / d e v / m e m h y p r i o t / r p i - g p i o w r i t e 0 o f f 24 / 29
  15. H y p r i o t O S :

    r o o t @ n o d e 2 i n ~ $ d o c k e r r u n - - r m - - c a p - a d d S Y S _ R A W I O - - d e v i c e / d e v / m e m h y p r i o t / r p i - g p i o r e a d 1 # w P i G P I O 1 / B C M 1 8 # 0 o r 1 26 / 29
  16. Refs 1. Docker Pirates ARMed with explosive stu 2. Mastering

    Docker on a Raspberry Pi 3. Let's get physical with Docker on the Raspberry Pi 4. WiringPi 28 / 29