Cloud Build allows you to build a Docker image using a Docker-file.You don’t require a separate Cloud Build config file.
A Docker-file is a text document that contains instructions for Docker to build an image. A Docker container image is a file that contains the source code, libraries, dependencies, and tools needed for an application to run. Due to their read-only quality, these images are sometimes referred to as snapshots. They represent an application and its virtual environment at a specific point in time. A docker container is a lightweight software application that runs applications isolated from underlying applications Docker containers are compact, portable units in which you can start up an application quickly and easily. Standardization ensures your application is working in identical circumstances, but it also simplifies sharing with other teammates. As containers are autonomous, they provide strong isolation, ensuring they do not interrupt other running containers Using Cloud Build, you can deploy container images from Container Registry and Artifact Registry to Cloud Run. You can deploy an existing image, build and deploy an image, or automate the deployment. Next, we need to set up the IAM roles where we allow admin access for the same to build and deploy a container image: Steps are as follows: 1)Create a yaml file. 2)add docker build setup to build images and push to container registry 3)You can automate the deployment of your software to Cloud Run by creating Cloud Build triggers. You can create your triggers to build and deploy images whenever you update your code. 4)In your repository root, add a config file with steps to build the image, push the image to Container Registry, and then invoke the gcloud run deploy command. When a container is deployed to a Cloud Run service, it runs with the identity of the Runtime Service account of this Cloud Run and thus we need to grant this permission to the IAM role
——– written by Sharvil