DevOps Classroom Series – 22/Jun/2020

Revision To Docker (Topics Covered So far)

  • Refer to Docker Earlier classroom notes

Practical Revision

  1. Create a Docker Image for Game of Life

    • Install JAVA
    • Install Tomcat
    • Download gameoflife from here into webapps folder of tomcat
    • Start tomcat => (http://<ip&gt;:8080/gameoflife)
    • Possible Solution-1
      1. Start with Ubuntu or centos as base image
      2. Install JAVA
      3. Install tomcat
      4. Find the location of webapps
      5. download the war file
      6. Start application
      FROM ubuntu:18.04
      RUN apt-get update && apt-get install openjdk-8-jdk tomcat8 -y
      ADD https://referenceappkhaja.s3-us-west-2.amazonaws.com/gameoflife.war /var/lib/tomcat8/webapps/gameoflife.war
      EXPOSE 8080
      
    • Possible Solution -2
      1. Start with Tomcat as base image
      2. Copy the war file
      3. start tomcat
    • Dockerfile
    FROM tomcat:8
    LABEL author="khaja"
    ADD https://referenceappkhaja.s3-us-west-2.amazonaws.com/gameoflife.war /usr/local/tomcat/webapps/gameoflife.war
    EXPOSE 8080
    CMD ["catalina.sh", "run"]
    
  2. Slim Images for Linux applications

    • Popularly alpine image is used
    • Explore alpine image and try to build gameoflife and spc in alpine

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin