[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eWhen running or debugging an application on Kubernetes, you must configure how your container image is built within the "Develop on Kubernetes" run configuration.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code supports building container images with Docker, Jib, or Buildpacks, and allows you to choose between building locally or using Cloud Build, which is advantageous for slower machines.\u003c/p\u003e\n"],["\u003cp\u003eFor projects without a \u003ccode\u003eskaffold.yaml\u003c/code\u003e file, Cloud Code's UI guides you through selecting a builder and build environment, saving your choices to a new \u003ccode\u003eskaffold.yaml\u003c/code\u003e file for future use.\u003c/p\u003e\n"],["\u003cp\u003eProjects with an existing \u003ccode\u003eskaffold.yaml\u003c/code\u003e require manual editing of build options, and Cloud Code offers snippets to assist with this.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code leverages Skaffold profiles to manage different build or deployment configurations, allowing for customization of environments like local or remote builds.\u003c/p\u003e\n"]]],[],null,["# Explore your build options with buildpacks, Jib, or Docker\n\nTo run or debug an application on Kubernetes, you'll need to set your\npreference for how your container image is built by configuring it in the\n**Develop on Kubernetes** run configuration.\n\nIn a project that doesn't contain a `skaffold.yaml` file at the root or doesn't\nreference `skaffold.yaml` you can use the Cloud Code UI to choose\na builder and build environment.\n\nBuilding locally is free of charge since it uses your own resources. Building\nwith [Cloud Build](/build) is good for slower machines or machines that\ndon't match the processor architecture of the target cluster. For information\nabout the cost of building your application using Cloud Build, see\n[Cloud Build Pricing](/build/pricing).\n\nSpecify how your images are built\n---------------------------------\n\nCloud Code supports\n[Docker](https://skaffold.dev/docs/pipeline-stages/builders/docker/),\n[Jib](https://skaffold.dev/docs/pipeline-stages/builders/jib/), and\n[Buildpacks](https://skaffold.dev/docs/pipeline-stages/builders/buildpacks/)\n[artifact types](https://skaffold.dev/docs/builders/).\n\n### Without a skaffold.yaml\n\nWhen importing an existing application without a `skaffold.yaml` file or running\nan application that doesn't have a `skaffold.yaml`, you're prompted to specify\nsettings when initializing.\n\nIf you're using one of the Cloud Code sample applications, to use\nthe UI, delete the `skaffold.yaml` file before running a build action. For steps\nto choose a builder and build environment without the UI, see\n[Manually creating a Skaffold configuration](/code/docs/shell/use-existing-kubernetes-app#manually_create_a_skaffold_configuration).\n\n1. In a project without a `skaffold.yaml` file, open the command palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e **Command Palette** ) and then run **Cloud Code: Run on Kubernetes** or **Cloud Code: Debug on Kubernetes**.\n2. In the **Build environment** section, choose a build environment.\n3. In the **Deploy settings** section, if you chose Cloud Build, specify the image registry you want Cloud Build to push images to.\n4. In the **Build settings** section, specify a builder (Docker, Jib, or buildpacks) for each image and its settings.\n5. Select or clear any of the configuration options and then click **Debug** or **Run**.\n\nThe options you choose are saved to a\n[`skaffold.yaml`](https://skaffold.dev/docs/references/yaml) file that you can\nedit directly for further customization.\n\n### With an existing skaffold.yaml\n\nFor a project with an existing `skaffold.yaml` file, you need to manually edit your build options. Cloud Code provides snippets for common YAML schema viewable by pressing `Command/Ctrl + Space`. See the the [Skaffold Build documentation](https://skaffold.dev/docs/builders/) for more details.\n\nUse Skaffold profiles in Cloud Code\n-----------------------------------\n\nCloud Code uses the Skaffold tool under the hood to power Cloud Code's build functionality. To configure Cloud Code for different build or deploy environments such as local or remote builds, [Skaffold profiles](https://skaffold.dev/docs/environment/profiles/) are used\n\nCreate a new skaffold profile\n-----------------------------\n\nIf you'd like to define build, test and deployment configurations for\ndifferent contexts, you can have different Skaffold profiles.\nThe following sample shows a profile named `cloudbuild` used to to build images with Cloud Build:\n\n\u003cbr /\u003e\n\n profiles:\n # use the cloudbuild profile to build images using Google Cloud Build\n - name: cloudbuild\n build:\n googleCloudBuild: {}\n\nIf you have multiple profiles, add the profile you want to use to your `launch.json` file. For more information on Skaffold profiles, see the [Skaffold profiles documentation](https://skaffold.dev/docs/environment/profiles/)\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- Use [file sync and hot reloading](/code/docs/shell/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- Learn more about [Cloud Native Buildpacks](https://buildpacks.io/).\n- Read about the benefits of [Cloud Build](/build)."]]