Explore your build options with buildpacks, Jib, or Docker
Stay organized with collectionsSave and categorize content based on your preferences.
To run or debug an application on Kubernetes, you'll need to set your
preference for how your container image is built by configuring it in theDevelop on Kubernetesrun configuration.
In a project that doesn't contain askaffold.yamlfile at the root or doesn't
referenceskaffold.yamlyou can use the Cloud Code UI to choose
a builder and build environment.
Building locally is free of charge since it uses your own resources. Building
withCloud Buildis good for slower machines or machines that
don't match the processor architecture of the target cluster. For information
about the cost of building your application using Cloud Build, seeCloud Build Pricing.
When importing an existing application without askaffold.yamlfile or running
an application that doesn't have askaffold.yaml, you're prompted to specify
settings when initializing.
If you're using one of the Cloud Code sample applications, to use
the UI, delete theskaffold.yamlfile before running a build action. For steps
to choose a builder and build environment without the UI, seeManually creating a Skaffold configuration.
In a project without askaffold.yamlfile, open the command palette
(pressCtrl/Cmd+Shift+Por clickView>Command Palette) and
then runCloud Code: Run on KubernetesorCloud Code: Debug on Kubernetes.
In theBuild environmentsection, choose a build environment.
In theDeploy settingssection, if you chose Cloud Build,
specify the image registry you want Cloud Build to push images
to.
In theBuild settingssection, specify a builder (Docker, Jib, or
buildpacks) for each image and its settings.
Select or clear any of the configuration options and then clickDebugorRun.
The options you choose are saved to askaffold.yamlfile that you can
edit directly for further customization.
With an existing skaffold.yaml
For a project with an existingskaffold.yamlfile, you need to manually edit
your build options. Cloud Code provides snippets for common YAML
schema viewable by pressingCommand/Ctrl + Space. See the theSkaffold Build documentationfor more details.
Use Skaffold profiles in Cloud Code
Cloud 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 profilesare used
Create a new skaffold profile
If you'd like to define build, test and deployment configurations for
different contexts, you can have different Skaffold profiles.
The following sample shows a profile namedcloudbuildused to to build images
with Cloud Build:
profiles:
# use the cloudbuild profile to build images using Google Cloud Build
- name: cloudbuild
build:
googleCloudBuild: {}
If you have multiple profiles, add the profile you want to use to yourlaunch.jsonfile.
For more information on Skaffold profiles, see theSkaffold profiles documentation
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\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)."]]