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

- 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
- code Refer Here
- tools:
- jdk 8
- git
- maven
- Refer Here for the solution
Pushing images to Registries
Docker Hub
- Public Registry: Docker Hub Refer Here
- Create a public Repository

- Repository will be in the form of
<username>/<repo-name>:<tag>

- After building the image tag the image to new naming format
docker image tag spc:3.0.0 shaikhajaibrahim/qtspringpetclinic:3.0.0

* if this image has to be default also tag with latest (optional)
docker image tag spc:3.0.0 shaikhajaibrahim/qtspringpetclinic:latest

* login into docker hub from cli
docker login

* lets push the images



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




- view push commands

- install and configure aws cli Refer Here
- follow as shown in class

Azure ACR
- Refer Here for detailed information
