Urgent.News

What's breaking now, across thousands of outlets.

Tech

Pushing Container Images to Google Cloud Artifact Registry (Step-by-Step)

When running Kubernetes locally with Docker Desktop, you have a handy superpower: your local Kubernetes cluster shares your computer's local Docker daemon. Any image you build via docker build is immediately available to your local pods without needing to push it to the internet. However, the moment you decide to deploy to a managed cloud cluster like Google Kubernetes Engine (GKE) , that magic…

To deploy container images to Google Cloud Artifact Registry, follow these steps:

1. Ensure you have a Google Cloud Platform account with an active project and billing enabled.

2. Install the Google Cloud SDK (gcloud CLI) and Docker on your machine.

3. Clone the sample microservices and Dockerfiles from GitHub: MitraKumar/kube-prac-calculator-app.

4. Authenticate with GCP from the terminal and set your active project ID.

5. Enable the Artifact Registry API for your project.

6. Create a Docker repository in Artifact Registry named "kkm-dock" in the asia-south1 region.

7. Configure Docker authentication using the gcloud command, which updates the ~/.docker/config.json file to obtain GCP access tokens.

8. Understand the image naming format for Artifact Registry: [REGION]-docker.pkg.dev/[PROJECT_ID]/[REPOSITORY_NAME]/[IMAGE_NAME]:[TAG].

9. Tag your local images with the Artifact Registry URL.

10. Push your tagged images to the cloud using the docker push command.

11. Verify the uploaded images in the command line or through the Google Cloud Console.

12. Update your Kubernetes manifests with the new image URLs in Artifact Registry.

By following these steps, your container images will be securely stored in Google Cloud Artifact Registry and accessible to your managed Kubernetes clusters.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Saturday 3 October →