anchor.diff:  :speaker-blog: http://krzysztof-sobkowiak.net
   :speaker-twitter: http://twitter.com/ksobkowiak[@ksobkowiak]
   
  -
  -//= Services Orchestration on OpenShift using Spring Cloud Kubernetes
   = Orchestrate Your Services on OpenShift using Spring Cloud Kubernetes
   
   //image::title-logo.png[align="center", width="30%"]
  
positive.code: --
  
  [.event]
  Capgemini Open Days +
  Wrocław, 6th of June 2017
  
  [.newline]
  {speaker}
  
negative.code: * Run -- scale to 1000s of nodes, move between data centers and clouds, update with zero downtime and more
  --
  
  // ----------------------------------------------------------------------------
  
  === Docker for Java Developers
  
  * Dockerfile
  +
  [source, dockerfile]
  ----
  FROM openjdk:latest
  
  ADD target/ipservice-boot-docker-0.0.1-SNAPSHOT.jar .
  EXPOSE 8090
  CMD /usr/bin/java -Xmx400m -Xms400m -jar ipservice-boot-docker-0.0.1-SNAPSHOT.jar
  ----
  * Build image
  +
  [source, bash]
  ----
  $ docker build . -t capgemini/ipservice-boot-docker
  
  $ docker images
  REPOSITORY                        TAG        IMAGE ID         CREATED          SIZE
  capgemini/ipservice-boot-docker   latest     e0e8d458c945     4 seconds ago    625MB
  openjdk                           latest     ab0ecda9094c     2 weeks ago      610MB
  ----
  * Run the container
  +
  [source, bash]
  ----
  $ docker run --name ipservice -d -p 8090:8090 capgemini/ipservice-boot-docker
  
  $ curl http://$(docker-machine ip ms):8090/ip
  {"id":1,"ipAddress":"172.17.0.2","message":"Hello from IP Service from Docker"}
  ----
  
  // ----------------------------------------------------------------------------
  
  === Maven Plugin
  
  [.noredheader,cols="58%,4%,38%"]
  |===
  .<a|
  [source, xml,linenums]
  ----
  <plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>0.21.0</version>
    <configuration>
      <images>
        <image>
          <alias>ipservice</alias>
          <name>capgemini/ipservice-boot-docker:latest</name>
          <build>
            <from>openjdk:latest</from>
            <assembly>
              <descriptorRef>artifact</descriptorRef>
            </assembly>
            <cmd>java -jar maven/${project.artifactId}-${project.version}.jar</cmd>
          </build>
        </image>
      </images>
    </configuration>
  </plugin>
  ----
  a|
  .<a|
  [source, bash]
  ----
  $ mvn docker:build
  $ mvn docker:start
  ----
  |
  |===
  
  // ----------------------------------------------------------------------------
  
  === Docker Compose
  
  [source,yaml]
  ----
    version: "3"
  
    services:
      ipservice:
        image: capgemini/ipservice-boot-docker:latest
        networks:
          - ipservice
  
      ipclient:
        image: capgemini/ipclient-boot-docker:latest
        ports:
          - "8090:8090"
        networks:
          - ipservice
  
    networks:
      ipservice:
  ----
  
  [source,bash]
  ----
  $ docker-compose up -d
  ----
  
  [source,bash]
  ----
  $ docker stack deploy --compose-file=docker-compose.yml ipdemo
  ----
  
  // ----------------------------------------------------------------------------
  
  