Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: Casablanca Release
    • Labels:
    • Sprint:
      LOG Sprint 8, LOG Sprint 10, Dublin-Logging

      Description

      The image can be pushed to the oomk8s dockerhub for expediency

      for now in

      https://hub.docker.com/r/obrienlabs/mock-logging-tomcat/

      This image should contain the RI war so we can run multiple copies of the image in a pod to simulate requestID passing in a couple simple rest calls between containers

       

       DockerFile

      get the war from the target dir of logging-demo

      FROM tomcat:8.0.48-jre8
      COPY logging-demo-1.2.0-SNAPSHOT.war /usr/local/tomcat/webapps/logging-demo.war

       

       

      
      

      obrienbiometrics:docker michaelobrien$ vi DockerFile
      obrienbiometrics:docker michaelobrien$ docker build -t mock-logging-tomcat -f DockerFile .
      Sending build context to Docker daemon  18.04MB
      Step 1/2 : FROM tomcat:8.0.48-jre8
      ---> e072422ca96f
      Step 2/2 : COPY logging-demo-1.2.0-SNAPSHOT.war /usr/local/tomcat/webapps/logging-demo.war
      ---> f0d234622af6
      Successfully built f0d234622af6
      Successfully tagged mock-logging-tomcat:latest
      obrienbiometrics:docker michaelobrien$ docker images | grep mock-logging
      mock-logging-tomcat                                           latest                            f0d234622af6        9 seconds ago       576MB
      obrienbiometrics:docker michaelobrien$ docker run -d -it --rm -p 8888:8080 mock-logging-tomcat:latest
      ef5bdffb0e0aef9f185a51be2a915eae3d72fdb9a2125e1bb373516137c205b4
      obrienbiometrics:docker michaelobrien$ docker ps
      CONTAINER ID        IMAGE                        COMMAND             CREATED             STATUS              PORTS                    NAMES
      ef5bdffb0e0a        mock-logging-tomcat:latest   "catalina.sh run"   5 seconds ago       Up 4 seconds        0.0.0.0:8888->8080/tcp   adoring_hawking
      obrienbiometrics:docker michaelobrien$ docker logs -f adoring_hawking

      20-Jan-2018 04:30:26.092 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization completed in 1352 ms
      20-Jan-2018 04:30:26.592 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /usr/local/tomcat/webapps/logging-demo.war has finished in 3,652 ms
      20-Jan-2018 04:30:26.841 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3943 ms
      ^C
      obrienbiometrics:docker michaelobrien$ curl http://localhost:8888/logging-demo/rest/read/test
      testing: org.onap.logging.ApplicationService@433552a
      obrienbiometrics:docker michaelobrien$ docker build -t obrienlabs/mock-logging-tomcat -f DockerFile .
      Sending build context to Docker daemon  18.04MB
      Step 1/2 : FROM tomcat:8.0.48-jre8
      ---> e072422ca96f
      Step 2/2 : COPY logging-demo-1.2.0-SNAPSHOT.war /usr/local/tomcat/webapps/logging-demo.war
      ---> Using cache
      ---> f0d234622af6
      Successfully built f0d234622af6
      Successfully tagged obrienlabs/mock-logging-tomcat:latest
      obrienbiometrics:docker michaelobrien$ docker tag obrienlabs/mock-logging-tomcat obrienlabs/mock-logging-tomcat:1
      obrienbiometrics:docker michaelobrien$ docker login
      Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
      Username (michaelobrien): obrienlabs
      Password:
      Login Succeeded
      obrienbiometrics:docker michaelobrien$ docker push obrienlabs/mock-logging-tomcat:1
      The push refers to a repository [docker.io/obrienlabs/mock-logging-tomcat]
      8bb560dc792d: Pushed
      7a5faefa0b46: Pushed
      d1a0f91a1ad8: Pushed
      c4d99fd86e94: Pushed
      04178c827c65: Pushed
      c571db474d75: Pushed
      93742a1ae069: Pushed
      7ffe9646653b: Pushed
      6ef532e39c1e: Pushed
      a4d7b0ac0438: Pushed
      06f4de5fefea: Pushed
      851f3e348c69: Pushed
      e27a10675c56: Pushed
      1: digest: sha256:a583f08001b21635e74e205f130ffbd23d933032686345be50f39a46b537e11b size: 3048

      run

      obrienbiometrics:docker michaelobrien$ docker run -d -it --rm -p 8888:8080 obrienlabs/mock-logging-tomcat:1
      316023a8abed5911000a1c366b7c897a33abcd7e9e70f48a4e2c2611f4c98d93
      obrienbiometrics:docker michaelobrien$ curl http://localhost:8888/logging-demo/rest/read/test
      testing: org.onap.logging.ApplicationService@75f0964b
      obrienbiometrics:docker michaelobrien$

      test on separate machine

      ubuntu@ip-172-31-52-161:~$ docker ps
      CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
      ubuntu@ip-172-31-52-161:~$ docker run -d -it  -p 8888:8080 obrienlabs/mock-logging-tomcat:1
      Unable to find image 'obrienlabs/mock-logging-tomcat:1' locally
      1: Pulling from obrienlabs/mock-logging-tomcat
      723254a2c089: Pull complete
      abe15a44e12f: Pull complete
      409a28e3cc3d: Pull complete
      a9511c68044a: Pull complete
      9d1b16e30bc8: Pull complete
      0fc5a09c9242: Pull complete
      d34976006493: Pull complete
      3b70003f0c10: Pull complete
      bc7887582e2e: Pull complete
      d2ab4f165865: Pull complete
      7a0257d5eec9: Pull complete
      a23d5c1d9825: Pull complete
      42f73552ced4: Pull complete
      Digest: sha256:a583f08001b21635e74e205f130ffbd23d933032686345be50f39a46b537e11b
      Status: Downloaded newer image for obrienlabs/mock-logging-tomcat:1
      4262ca54a570a177185b646ec92b440f37250f7ee2922e018aec5d226c5b4f2a
      ubuntu@ip-172-31-52-161:~$ docker ps
      CONTAINER ID        IMAGE                              COMMAND             CREATED             STATUS              PORTS                    NAMES
      4262ca54a570        obrienlabs/mock-logging-tomcat:1   "catalina.sh run"   9 seconds ago       Up 8 seconds        0.0.0.0:8888->8080/tcp   kickass_hoover
      ubuntu@ip-172-31-52-161:~$ curl http://dev.onap.info:8888/logging-demo/rest/read/test
      testing: org.onap.logging.ApplicationService@86a2339
      ubuntu@ip-172-31-52-161:~${noformat}

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                michaelobrien Michael O'Brien
                Reporter:
                michaelobrien Michael O'Brien
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h