Menyimpan image container di Cloud Code for VS Code
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk menjalankan atau men-debug aplikasi di cluster Kubernetes jarak jauh, Anda harus menentukan repositori image container untuk project Anda. Anda dapat menggunakan penyedia repositori
gambar apa pun, termasuk Artifact Registry.
Menentukan tempat penyimpanan image container
Jika Anda login ke Google Cloud di IDE dan memiliki project default yang ditentukan, Cloud Code akan otomatis menggunakan repositori image container default gcr.io/PROJECT_ID, dengan PROJECT_ID mereferensikan project default Anda.
Jika Anda ingin mengupdate repositori gambar tempat gambar project
di-push, ikuti petunjuk berikut:
Buka Command Palette (tekan Ctrl/Cmd+Shift+P), lalu jalankan perintah
Cloud Code: Run on Kubernetes.
Konfirmasi apakah akan menggunakan
konteks Kubernetes
saat ini untuk menjalankan aplikasi (atau beralih ke konteks yang diinginkan).
Anda akan diminta untuk memilih registry image.
Masukkan repositori image tempat Anda ingin menyimpan gambar.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[[["\u003cp\u003eTo deploy applications to a remote Kubernetes cluster, you must define the container image repository, which can be any provider, including Artifact Registry.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code automatically uses \u003ccode\u003egcr.io/PROJECT_ID\u003c/code\u003e as the default container image repository if you're logged into Google Cloud in your IDE and have a default project set, unless you are on a local cluster.\u003c/p\u003e\n"],["\u003cp\u003eYou can change the image repository by using the "Cloud Code: Run on Kubernetes" command in the Command Palette and selecting your preferred registry.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code generates the final image repository name by concatenating the image registry with the image name specified in the Kubernetes manifests.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides examples of common image repository formats for Docker Hub, Artifact Registry, AWS ECR, and Azure Container Registry.\u003c/p\u003e\n"]]],[],null,["# Store your container images in Cloud Code for VS Code\n\nTo run or debug an application on a remote Kubernetes cluster, you'll need to\ndefine the container image repository for your project. You can use any image\nrepository provider, including [Artifact Registry](/artifact-registry/docs).\n\nSpecify where container images are stored\n-----------------------------------------\n\nIf you're logged into Google Cloud in your IDE and you have a\ndefault project defined, Cloud Code automatically uses your\ndefault container image repository\n**gcr.io/\u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e** , where\n\u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e references your default project.\n| **Note:** If you are running on a local cluster like minikube or Docker Desktop, you do not need to specify these configurations.\n\nIf you'd like to update the image repository where the project\nimages are pushed, follow these instructions:\n\n1. Open the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P`) and then run the **Cloud Code: Run on Kubernetes** command.\n2. Confirm whether to use the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) to run the app in (or switch to a preferred one).\n3. You are prompted to select an image registry.\n4. Enter the image repository you want to store your images in.\n\n If your project has [Artifact Registry API enabled](/artifact-registry/docs/enable-service)\n and at least one [Artifact Registry repository](/artifact-registry/docs/manage-repos),\n you can browse to and select an existing Artifact Registry repository.\n\nSee the [common image repository formats](#image_formats) section for examples\nof how to specify where container images are stored for some common registries.\n\n### Image name creation\n\nCloud Code concatenates the image registry with the image name\nspecified in the Kubernetes manifests to generate the final image repository\nname.\n\nFor more information, see the\n[image registry handling guide](https://skaffold.dev/docs/environment/image-registries).\n\nThis choice is stored in your `cloudcode.kubernetes` launch configuration\n(found in .vscode/launch.json).\n\n\nCloud Code builds your containers, pushes them to the registry,\napplies Kubernetes configurations to the cluster, and waits for the rollout.\n\n### Common image repository formats\n\nHere are examples of how to specify where container images are stored for some\ncommon registries:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- [Create and configure a GKE cluster](/code/docs/vscode/create-configure-gke-cluster).\n- Learn more about [Artifact Registry](/artifact-registry/docs/overview).\n\nGet Support\n-----------\n\nTo send feedback, report issues on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-vscode/issues), or ask a question on [Stack Overflow](https://stackoverflow.com/questions/ask?tags=cloud-code-vscode)."]]