[[["易于理解","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-08-19。"],[],[],null,["# Build and deploy Windows IIS workloads\n======================================\n\nThis page explains how to build and deploy your Windows application containers\nusing Skaffold.\n| **Note:** Using Skaffold is the recommended approach, but is not required. You can also build directly with [Docker `build`](https://docs.docker.com/build/) and apply the changes with [`kubectl`](https://kubernetes.io/docs/reference/kubectl/).\n\nSkaffold handles the workflow for building, pushing and deploying your\napplication. The Skaffold configuration `skaffold.yaml` is at the root\nfolder of the generated artifacts. To learn how to edit the `skaffold.yaml`\nfile, see the\n[Skaffold file reference](https://skaffold.dev/docs/references/yaml/).\n\nBefore you begin\n----------------\n\nThis document assumes that you've completed the migration and reviewed the\ngenerated migration artifacts.\n\nBuild the container image\n-------------------------\n\nThe configuration generated by Migrate to Containers CLI lets\nyou build single-arch images on a Windows machine, as well as\n[multi-arch images using Cloud Build](/kubernetes-engine/docs/tutorials/building-windows-multi-arch-images)\non a Linux machine.\n\nIf you use Cloud Shell, Skaffold is already installed. If you need to install\nSkaffold, see [Installing Skaffold](https://skaffold.dev/docs/install/).\n\n### Build a single-arch image on a Windows machine\n\nOn a Windows machine, build a single-arch container image using Skaffold: \n\n skaffold build -d \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e --cache-artifacts=false\n\nReplace \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e with the path to your artifact repository.\nFor example,\n`us-central1-docker.pkg.dev/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003eREPOSITORY_NAME\u003c/var\u003e.\n\nIf you want to build and deploy the container image in the same step, then you\ncan replace the `build` command with the `run` command.\n\n### Build a multi-arch image on a Linux machine\n\nSet the following environment variables:\n\n- Mandatory\n - `CLOUDBUILD_PROJECT`: the project where you want Cloud Build to run\n - `REGION`: the region in which Cloud Build will run\n - `ZONE`: the zone in which Cloud Build will run\n- Optional - If the network and subnetwork are not specified, the default VPC and default subnetwork are used.\n - `NETWORK`: the network in which the Windows builder VMs will be created (VPC name)\n - `SUBNETWORK`: the subnetwork in which the Windows builders will be created\n\nFollow the instructions in [Building multi-arch images](/kubernetes-engine/docs/tutorials/building-windows-multi-arch-images#building_multi-arch_images_using_the_gke-windows-builder).\n\nIf you want to use custom worker pools for Cloud Build (to avoid firewall\nrules creation for example), set the following environment variables:\n\n- Mandatory\n - `WORKERPOOL`: the name of the workerpool\n - `WORKERPOOL_REGION`: the region of the workerpool\n- Optional\n - `USE_INTERNAL_IP`: true if the workerpool is connected with a shared VPC to `NETWORK`\n\nThe following are the commands to run a Windows build: \n\n export CLOUDBUILD_PROJECT=\u003cvar translate=\"no\"\u003eCLOUDBUILD_PROJECT\u003c/var\u003e\n export REGION=\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e\n export ZONE=\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e\n\n skaffold build -d \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e with the path to your artifact repository.\nFor example,\n`us-central1-docker.pkg.dev/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003eREPOSITORY_NAME\u003c/var\u003e.\n\nIf you want to build and deploy the container image in the same step, then you\ncan replace the `build` command with the `run` command.\n\nDeploy the container image\n--------------------------\n\nAfter the container image is built, use Skaffold to deploy it: \n\n skaffold run -d \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eREPOSITORY_PATH\u003c/var\u003e with the path to your artifact repository.\nFor example,\n`us-central1-docker.pkg.dev/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003eREPOSITORY_NAME\u003c/var\u003e.\n\nWhat's next\n-----------\n\n- Learn how to [monitor migrated workloads](/migrate/containers/docs/monitoring-migrated-workloads).\n- Learn how to troubleshoot the issue [Skaffold build for Windows images fails](/migrate/containers/docs/troubleshooting/issues-with-windows-iis#skaffold_build_for_windows_images_fails)."]]