Gebruik dezelfde docker container voor java applicaties tijdens ontwikkelen en in de cloud
1 / 65

Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen en in de cloud - PowerPoint PPT Presentation

  • Uploaded on

Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen en in de cloud. Johan Janssen, Info Support. Content. Continuous delivery Docker Jenkins Questions. Continuous Delivery. Automate everything Software quality Continuous improvement Regular deployments

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen en in de cloud' - nissim-gallagher

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Gebruik dezelfde docker container voor java applicaties tijdens ontwikkelen en in de cloud

Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen en in de cloud

Johan Janssen, Info Support


  • Continuous delivery

  • Docker

  • Jenkins

  • Questions

Continuous delivery
Continuous Delivery

  • Automate everything

  • Software quality

  • Continuous improvement

  • Regular deployments

  • Anyone can deploy

Deployment pipeline
Deployment pipeline

Setup environment

Quality checks

Version control






End users

Focus of this presentation
Focus of this presentation

  • Automate environment provisioning

  • Automate application deployment

Docker compatibility
Docker compatibility

Why docker
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

Docker vs virtual machines
Docker vs Virtual Machines

  • Disk space efficiency

  • Memory efficiency

  • Speed

  • Compatibility (run anywhere)

  • Isolation

  • Versioning

  • Internet of Things (Raspberry Pi etc.)

Docker vs provisioning tools
Docker vs provisioning tools

  • Simple general commands

  • No Domain Specific Language (DSL)

  • Configuration with operating system commands

Docker activity
Docker activity

  • Since March 2013

  • 8741 commits in 15 months

  • More than 460 570 contributors

  • Downloaded 2.75 13 million times

  • More than 14000 30000 Dockerized apps

  • >6500 Docker related projects on GitHub

  • More than 90 user groups

  • DockerCon (Europe)

  • Support from Google, VMWare, RackSpace, Red Hat, IBM, Microsoft etcetera

Docker on cio today
Docker on CIO TODAY

Windows will get docker support
Windows will get Docker support

My first docker container
My first Docker container

  • Docker on Ubuntu 14.04

    apt-get install run -i -t ubuntu:saucy /bin/bash

Docker technology
Docker technology

Dockerfiles directory structure
Dockerfiles directory structure

  • Main directory


    • GeneralBase

      • Dockerfile

    • Sonar

      • Dockerfile

Dockerfile generalbase

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

Dockerfile sonar
Dockerfile Sonar

FROM GeneralBase

RUN apt-get install -y wget unzip

RUN wget

RUN unzip -d /opt

RUN rm



CMD ["/opt/sonarqube-4.2/bin/linux-x86-64/", "console", "/bin/bash"]


  • Create the Dockerfiles

  • Build the containers:

    <optional>cd GeneralBase build -t GeneralBase .

    cd .. </optional>

    cd Sonar build -t Sonar .


  • Start the container run -p 9000:9000

    –p 9092:9092 -d Sonar

List all in active containers
List all in(active) containers

# ps –a

CONTAINER ID: ecbecf77461b

CREATED: 32 minutes ago

STATUS: Up 32 minutes


Controlling containers
Controlling containers

  • Start / stop / restart

    docker [start/stop/restart] containerid

  • Follow SystemOut and SystemErr

    docker logs -f containerid

Controlling containers1
Controlling containers

  • Show (running) containers

    dockerps –a

  • Show processes running in container

    docker top containerid

  • Show changes in the container

    docker diff containerid

Controlling containers2
Controlling containers

  • Stop all containers stop $( ps -a -q)

  • Remove all containers rm $( ps -a -q)

  • Remove all images rmi $( images -q)

We need lots of docker containers
We need lots of Docker containers

Data volumes
Data volumes

  • Dockerfile

    ENV JENKINS_HOME /var/JenkinsData

  • Docker commands run -v /var/JenkinsData –name

    JenkinsDataContainerubuntu:saucy true run -p 8080:8080 --volumes-from

    JenkinsDataContainer -d Jenkins


# 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

Execution time
Execution time

real 4m11.729s

user 0m3.329s

sys 0m10.054s

Docker overview
Docker overview

Docker registry
Docker registry

  • Creating the Docker registry

    docker run -p 5000:5000 registry

Docker client 1 push
Docker client 1 (push)

  • Modify container

  • Commit commit 064f

  • New containerid -> ff7e

  • Push push

Docker client 2 pull
Docker client 2 (pull)

  • Pull pull


  • Run run -i -t ff7e /bin/bash

  • View the changed container

Pull update only
Pull update only

docker images -tree

└─153b 194.2 MB test-version-0.1:latest

docker pull

ff7e: Download complete

153b: Download complete

docker images -tree

└─153b 194.2 MB test-version-0.1:latest

└─ff7e 194.2 MB test-version-0.2:latest

Docker vs virtual machines1
Docker vs Virtual Machines

Why jenkins
Why Jenkins

  • Simple to use

  • Really popular

    • Used in many organizations

    • Regular updates

    • Big community creating plugins etc.

  • Most developers already use it

Example build pipeline
Example build pipeline














Frontend pipeline
Frontend pipeline

Combined pipeline
Combined pipeline

Automatic versus manual deployment
Automatic versus manual deployment

Continuous deployment

Continuous delivery

Publish over ssh plugin
Publish over SSH plugin

Publish over ssh plugin1
Publish over SSH plugin

Keep it simple
Keep it simple

“Life is really simple, but we insist on making it complicated.”

- Confucius

Build pipeline demo
Build pipeline demo


  • 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


[email protected]