Presentation is loading. Please wait.

Presentation is loading. Please wait.

Johan Janssen, Info Support. Internet of Things Docker and Java on a Raspberry Pi Jenkins Questions.

Similar presentations


Presentation on theme: "Johan Janssen, Info Support. Internet of Things Docker and Java on a Raspberry Pi Jenkins Questions."— Presentation transcript:

1 Johan Janssen, Info Support

2 Internet of Things Docker and Java on a Raspberry Pi Jenkins Questions

3

4 Huge and still growing Not stable yet, lots of innovation Cool new technologies Suitable for Java!

5

6

7

8

9

10

11

12 Continuous Delivery Virtual machines Provisioning (Chef, Puppet, Vagrant …) Version control / infrastructure as code Isolation Updating and synchronizing environments

13

14

15

16

17

18

19

20

21

22 To enable continuous delivery Quickly provision environments Easy to roll forward Security For instance to run ‘untrusted’ applications like a Dropbox client Alternative for virtual machines On top of virtual machines

23 Disk space efficiency Memory efficiency Speed Compatibility (run anywhere) Isolation Versioning Internet of Things (Raspberry Pi etc.)

24 Simple general commands No Domain Specific Language (DSL) Configuration with operating system commands

25 Since March 2013 More than 460 570 contributors Downloaded 2.75 13 million times More than 14000 30000 Dockerized apps More than 90 user groups, DockerCon (Europe) Support from Google, VMWare, RackSpace, Red Hat, IBM, Microsoft etcetera

26

27

28 Docker on Ubuntu 14.04 apt-get install docker.io docker.io run -i -t ubuntu:saucy /bin/bash

29 Docker on the Raspberry Pi docker run -i –t resin/rpi-raspbian /bin/bash

30

31 Download Arch Linux http://downloads.raspberrypi.org/arch_latest http://downloads.raspberrypi.org/arch_latest unzip ArchLinuxARM-2014.06-rpi.img.zip Find SD card: sudo fdisk -l sudo dd bs=1M if=ArchLinuxARM-2014.06- rpi.img of=/dev/sdX Change partitions (optional) Put the SD card in the Raspberry Pi and boot username and password are both ‘root’

32 Update repositories pacman –Syy Optional update al packages: pacman -Syu Install Docker pacman -S docker

33 Start Docker service systemctl start docker Auto start Docker service on boot systemctl enable docker Reboot

34 cp /etc/netctl/examples/ethernet-static /etc/netctl/static Edit /etc/netctl/static Description='A basic static ethernet connection' Interface=eth0 Connection=ethernet AutoWired=yes IP=static Address=('192.168.1.3/24') Gateway='192.168.1.1' DNS=('192.168.1.1')

35 Enable static ip netctl enable static Disable static ip mv /etc/netctl/static /etc/netctl/examples/

36 FROM resin/rpi-raspbian RUN apt-get update RUN apt-get install -y openjdk-7-jre-headless wget RUN wget -O /tmp/tomcat8.tar.gz http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat- 8.0.9.tar.gz RUN (cd /opt && tar zxf /tmp/tomcat8.tar.gz) RUN (mv /opt/apache-tomcat* /opt/tomcat) ENV JAVA_HOME /usr/lib/jvm/java-1.7.0-openjdk-armhf RUN rm -rf /opt/tomcat/webapps/docs /opt/tomcat/webapps/examples /opt/tomcat/webapps/host-manager /opt/tomcat/webapps/manager EXPOSE 8080 CMD ["/opt/tomcat/bin/catalina.sh", "run"]

37 FROM resin/rpi-raspbian RUN apt-get install -y openjdk-7-jre-headless wget ENV JAVA_HOME /usr/lib/jvm/java-1.7.0-openjdk- armhf EXPOSE 8080 CMD ["/opt/tomcat/bin/catalina.sh", "run"]

38 FROM tomcat ADD DockerPiExample.war /opt/tomcat/webapps/

39 Main directory BuildAndRunScript.sh Tomcat Dockerfile TomcatExtra Dockerfile DockerPiExample.war

40 Create the Dockerfiles Build the containers cd Tomcat (optional) docker build -t tomcat. (optional) cd.. (optional) cd TomcatExtra docker build -t tomcatextra.

41 Start the container docker run -p 8080:8080 -d tomcatextra

42 April Fools prank It might become real

43

44 Start / stop / restart docker [start/stop/restart] containerid Follow SystemOut and SystemErr docker logs -f containerid

45 Show (running) containers docker ps –a Show processes running in container docker diff containerid Show changes in the container docker top containerid

46 Stop all containers docker.io stop $(docker.io ps -a -q) Remove all containers docker.io rm $(docker.io ps -a -q) Remove all images docker.io rmi $(docker.io images -q)

47

48

49

50 Creating the Docker registry docker run -p 5000:5000 registry

51 Change container (using touch for instance) Commit docker.io commit 064f 192.168.56.31:5000/test-version-0.2 New containerid -> ff7e Push docker.io push 192.168.56.31:5000/test-version-0.2

52 Pull docker.io pull 192.168.56.31:5000/test-version-0.2 Run docker.io run -i -t ff7e /bin/bash

53

54 docker images -tree └─153bf43b408a 194.2 MB test-version-0.1:latest docker pull 192.168.56.31:5000/test-version-0.2 ff7e110ebadd: Download complete 153bf43b408a: Download complete docker images -tree └─153bf43b408a 194.2 MB test-version-0.1:latest └─ff7e110ebadd 194.2 MB test-version-0.2:latest

55 Commands are easier Faster and easier migration

56 Requires less extra resources Containers are the same, for instance when using apt-get update Not the latest security patches

57

58 GeneralBase AppServerBase Environment D Environment T Environment A Environment P Jenkins JenkinsDataContainer SonarGitblitNexus

59 # docker.io images --tree └─ 179.9 MB Tags: ubuntu:saucy └─253.6 MB └─741.8 MB Tags: GeneralBase:latest └─763.6 MB Tags: AppServerBase:latest ├─763.6 MB Tags: EnvironmentP:latest └─865.6 MB Tags: Nexus:latest └─808.3 MB Tags: Gitblit:latest └─901.5 MB Tags: Sonar:latest └─805.4 MB Tags: Jenkins:latest

60 real4m11.729s user0m3.329s sys0m10.054s

61

62 Simple to use Really popular Used in many organizations Regular updates Big community creating plugins etc. Most developers already use it

63

64 Deploy the first container when the hardware is nearby this saves network traffic Use a (private) Docker registry Keep environmental settings separate Start playing with Docker!

65 Big potential market for Docker and Java Easy to use Highly flexible and customizable

66

67

68

69

70 johan.janssen@infosupport.com


Download ppt "Johan Janssen, Info Support. Internet of Things Docker and Java on a Raspberry Pi Jenkins Questions."

Similar presentations


Ads by Google