DevOps Classroomnotes 16/Apr/2023

Multi Stage Docker build

  • Multi staged build is used to build the code and copy necessary files into the final stage which will be your image
    Preview
  • Refer Here for official docs

Scenario – 1: Java Spring petclinic

  • To build this application we need
    • jdk17
    • maven
    • git
  • Manual steps:
git clone https://github.com/spring-projects/spring-petclinic.git
cd spring-petclinic 
mvn package
# a file gets created in target/spring-petclinic-*.jar
  • To run this application we need jdk 17
  • Refer Here for the changes done to create spring petclinic as multistage build

Scenario -2 Game of life

Pushing images to Registries

Docker Hub

  • Public Registry: Docker Hub Refer Here
  • Create a public Repository
    Preview
  • Repository will be in the form of <username>/<repo-name>:<tag>
    Preview
  • After building the image tag the image to new naming format
docker image tag spc:3.0.0 shaikhajaibrahim/qtspringpetclinic:3.0.0

Preview
* if this image has to be default also tag with latest (optional)

docker image tag spc:3.0.0 shaikhajaibrahim/qtspringpetclinic:latest

Preview
* login into docker hub from cli

docker login

Preview
* lets push the images
Preview
Preview
Preview

Private Registries

  • There are many applciations for hosting private registries
    • AWS: ECR (Elastic container registry)
    • Azure: ACR (Azure Container Registry)
    • Jfrog

AWS ECR

  • Create an ECR Repository
    Preview
    Preview
    Preview
    Preview
  • view push commands
    Preview
  • install and configure aws cli Refer Here
  • follow as shown in class
    Preview

Azure ACR

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Wordpress Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube