using docker and jenkins to deploy and run applications on the raspberry pi and in the cloud
DESCRIPTION
Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud. Johan Janssen, @johanjanssen42, Info Support. Content. Internet of things Continuous delivery Docker Jenkins Questions. Internet of Things. Developments outside the IoT. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/1.jpg)
Using Docker and Jenkins to deploy and run applications
on the Raspberry Pi and in the cloud.
Johan Janssen, @johanjanssen42, Info Support
![Page 2: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/2.jpg)
Content
Internet of things
Continuous delivery
Docker
Jenkins
Questions
![Page 3: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/3.jpg)
Internet of Things
![Page 4: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/4.jpg)
Developments outside the IoT
Continuous Delivery Virtual machines Provisioning (Chef, Puppet, Vagrant …) Version control / infrastructure as code Isolation
Updating and synchronizing environments
![Page 5: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/5.jpg)
IoT limitations
![Page 6: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/6.jpg)
![Page 7: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/7.jpg)
Hyper Text Coffee Pot Control Protocol
April Fools prank
It might become real
![Page 8: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/8.jpg)
Docker
![Page 9: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/9.jpg)
Demo
![Page 10: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/10.jpg)
Continuous Delivery Automate everything Software quality Continuous improvement Regular deployments Anyone can deploy
![Page 11: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/11.jpg)
Deployment pipeline
Version control
Compile
Quality checks
Testing
Deployments
DevOps End users
Etcetera
Setup environment
![Page 12: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/12.jpg)
Deployment pipeline
![Page 13: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/13.jpg)
Focus of this presentation
Automate environment provisioning
Automate application deployment
![Page 14: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/14.jpg)
What to deliver?
![Page 15: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/15.jpg)
Why Docker To enable continuous delivery Quickly provision environments Run the same software local and in the
cloud Easy to move software
Better performance Higher availability Cheaper
![Page 16: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/16.jpg)
Docker vs Virtual Machines Disk space efficiency Memory efficiency Speed Compatibility (run anywhere) Isolation Versioning Internet of Things (Raspberry Pi etc.)
![Page 17: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/17.jpg)
Docker vs provisioning tools
Simple general commands No Domain Specific Language (DSL) Configuration with operating system
commands
![Page 18: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/18.jpg)
Dockerfile GeneralBaseFROM ubuntu:saucy
RUN apt-get -y install software-properties-commonRUN add-apt-repository ppa:webupd8team/javaRUN apt-get update && apt-get -y upgradeRUN echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selectionsRUN apt-get -y install oracle-java7-installerENV JAVA_HOME /usr/lib/jvm/java-7-oracle
![Page 19: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/19.jpg)
Dockerfile SonarFROM GeneralBase
RUN apt-get install -y wget unzipRUN wget http://dist.sonar.codehaus.org/sonarqube-4.2.zipRUN unzip sonarqube-4.2.zip -d /optRUN rm sonarqube-4.2.zip
EXPOSE 9000 EXPOSE 9092CMD ["/opt/sonarqube-4.2/bin/linux-x86-64/sonar.sh", "console", "/bin/bash"]
![Page 20: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/20.jpg)
We need lots of Docker containers
GeneralBase
AppServerBase
Environment D
Environment T
Environment A
Environment P
Jenkins
JenkinsDataContainer
Sonar Gitblit Nexus
![Page 21: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/21.jpg)
Data volumes Dockerfile
ENV JENKINS_HOME /var/JenkinsData
Docker commandsdocker.io run -v /var/JenkinsData –name JenkinsDataContainer ubuntu:saucy true
docker.io run -p 8080:8080 --volumes-from JenkinsDataContainer -d Jenkins
![Page 22: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/22.jpg)
Diskspace# 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
![Page 23: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/23.jpg)
Execution time
real 4m11.729suser 0m3.329s sys 0m10.054s
![Page 24: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/24.jpg)
Docker overview
![Page 25: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/25.jpg)
One ring to rule them all
![Page 26: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/26.jpg)
Docker registry
Creating the Docker registrydocker run -p 5000:5000 registry
![Page 27: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/27.jpg)
Docker client 1 (push) Modify container (for instance with touch) Commit
docker.io commit 064f192.168.56.31:5000/test-version-0.2
New containerid -> ff7e
Pushdocker.io push
192.168.56.31:5000/test-version-0.2
![Page 28: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/28.jpg)
Docker client 2 (pull) Pull
docker.io pull 192.168.56.31:5000/test-version-0.2
Rundocker.io run -i -t ff7e /bin/bash
View the changed container
![Page 29: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/29.jpg)
Updating containers
![Page 30: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/30.jpg)
Pull update onlydocker images -tree└─153bf43b408a 194.2 MB test-version-0.1:latest
docker pull 192.168.56.31:5000/test-version-0.2 ff7e110ebadd: Download complete153bf43b408a: Download complete
docker images -tree└─153bf43b408a 194.2 MB test-version-0.1:latest └─ff7e110ebadd 194.2 MB test-version-0.2:latest
![Page 31: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/31.jpg)
Jenkins
![Page 32: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/32.jpg)
Demo
![Page 33: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/33.jpg)
Why Jenkins Simple to use Really popular
Used in many organizations Regular updates Big community creating plugins etc.
Most Java developers already use it
![Page 34: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/34.jpg)
Jenkins
![Page 35: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/35.jpg)
Backend pipeline
![Page 36: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/36.jpg)
Frontend pipeline
![Page 37: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/37.jpg)
Combined pipeline
![Page 38: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/38.jpg)
Automatic versus manual deployment
Continuous delivery
Continuous deployment
![Page 39: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/39.jpg)
Automatic versus manual
![Page 40: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/40.jpg)
Build pipeline plugin
![Page 41: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/41.jpg)
Example build pipeline
TAP
D
1
2
34
7
8
9
10
56?
6?
![Page 42: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/42.jpg)
Publish over SSH plugin
![Page 43: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/43.jpg)
Publish over SSH plugin
![Page 44: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/44.jpg)
Keep it simple“Life is really simple, but we insist on making it complicated.”
- Confucius
![Page 45: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/45.jpg)
Build pipeline demo
![Page 46: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/46.jpg)
Tips Use a (private) Docker registry Use images from the registry instead of export Keep environmental settings separate Use Jenkins to manage everything Do not add extra functionality like OpenSSH Think about topics such as security, monitoring
and logging Separate concerns in separate containers Inherit containers
![Page 47: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/47.jpg)
Isolation
![Page 48: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/48.jpg)
Isolation
![Page 49: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/49.jpg)
Isolation
![Page 50: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/50.jpg)
Isolation
![Page 51: Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud](https://reader035.vdocuments.net/reader035/viewer/2022062221/56812ca9550346895d91565f/html5/thumbnails/51.jpg)
Summary