1 / 52

Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud .

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.

Télécharger la présentation

Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud .

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Docker and Jenkins to deploy and run applications on the Raspberry Pi and in the cloud. Johan Janssen, @johanjanssen42, Info Support

  2. Content • Internet of things • Continuous delivery • Docker • Jenkins • Questions

  3. Internet of Things

  4. Developments outside the IoT • Continuous Delivery • Virtual machines • Provisioning (Chef, Puppet, Vagrant …) • Version control / infrastructure as code • Isolation • Updating and synchronizing environments

  5. IoT limitations

  6. Hyper Text Coffee Pot Control Protocol • April Fools prank • It might become real

  7. Docker

  8. Demo

  9. Continuous Delivery • Automate everything • Software quality • Continuous improvement • Regular deployments • Anyone can deploy

  10. Deployment pipeline Setup environment Quality checks Version control Compile Testing Deployments Etcetera DevOps End users

  11. Deployment pipeline

  12. Focus of this presentation • Automate environment provisioning • Automate application deployment

  13. What to deliver?

  14. 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

  15. Docker vs Virtual Machines • Disk space efficiency • Memory efficiency • Speed • Compatibility (run anywhere) • Isolation • Versioning • Internet of Things (Raspberry Pi etc.)

  16. Docker vs provisioning tools • Simple general commands • No Domain Specific Language (DSL) • Configuration with operating system commands

  17. DockerfileGeneralBase FROM ubuntu:saucy RUN apt-get -y install software-properties-common RUN add-apt-repository ppa:webupd8team/java RUN apt-get update && apt-get -y upgrade RUN echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selections RUN apt-get -y install oracle-java7-installer ENV JAVA_HOME /usr/lib/jvm/java-7-oracle

  18. Dockerfile Sonar FROM GeneralBase RUN apt-get install -y wgetunzip RUN wget http://dist.sonar.codehaus.org/sonarqube-4.2.zip RUN unzip sonarqube-4.2.zip -d /opt RUN rm sonarqube-4.2.zip EXPOSE 9000 EXPOSE 9092 CMD ["/opt/sonarqube-4.2/bin/linux-x86-64/sonar.sh", "console", "/bin/bash"]

  19. We need lots of Docker containers

  20. Data volumes • Dockerfile ENV JENKINS_HOME /var/JenkinsData • Docker commands docker.io run -v /var/JenkinsData–name JenkinsDataContainerubuntu:saucy true docker.io run -p 8080:8080 --volumes-from JenkinsDataContainer -d Jenkins

  21. 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

  22. Execution time real 4m11.729s user 0m3.329s sys 0m10.054s

  23. Docker overview

  24. One ring to rule them all

  25. Docker registry • Creating the Docker registry docker run -p 5000:5000 registry

  26. Docker client 1 (push) • Modify container (for instance with touch) • 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

  27. Docker client 2 (pull) • Pull docker.io pull 192.168.56.31:5000/test-version-0.2 • Run docker.io run -i -t ff7e /bin/bash • View the changed container

  28. Updating containers

  29. Pull update only dockerimages -tree └─153bf43b408a 194.2 MB test-version-0.1:latest dockerpull 192.168.56.31:5000/test-version-0.2 ff7e110ebadd: Download complete 153bf43b408a: Download complete dockerimages -tree └─153bf43b408a 194.2 MB test-version-0.1:latest └─ff7e110ebadd 194.2 MB test-version-0.2:latest

  30. Jenkins

  31. Demo

  32. Why Jenkins • Simple to use • Really popular • Used in many organizations • Regular updates • Big community creating plugins etc. • Most Java developers already use it

  33. Jenkins

  34. Backend pipeline

  35. Frontend pipeline

  36. Combined pipeline

  37. Automatic versus manual deployment Continuous deployment Continuous delivery

  38. Automatic versus manual

  39. Build pipeline plugin

  40. Example build pipeline 1 6? 6? 2 5 D 7 8 T 9 4 A 3 10 P

  41. Publish over SSH plugin

  42. Publish over SSH plugin

  43. Keep it simple “Life is really simple, but we insist on making it complicated.” - Confucius

  44. Build pipeline demo

  45. 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

  46. Isolation

  47. Isolation

  48. Isolation

  49. Isolation

More Related