Build and deploy Windows IIS workloads

This page explains how to build and deploy your Windows application containers using Skaffold.

Skaffold handles the workflow for building, pushing and deploying your application. The Skaffold configuration skaffold.yaml is at the root folder of the generated artifacts. To learn how to edit the skaffold.yaml file, see the Skaffold file reference.

Before you begin

This document assumes that you've completed the migration and reviewed the generated migration artifacts.

Build the container image

The configuration generated by Migrate to Containers CLI lets you build single-arch images on a Windows machine, as well as multi-arch images using Cloud Build on a Linux machine.

If you use Cloud Shell, Skaffold is already installed. If you need to install Skaffold, see Installing Skaffold.

Build a single-arch image on a Windows machine

On a Windows machine, build a single-arch container image using Skaffold:

skaffold build -d REPOSITORY_PATH --cache-artifacts=false

Replace REPOSITORY_PATH with the path to your artifact repository. For example, us-central1-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME.

If you want to build and deploy the container image in the same step, then you can replace the build command with the run command.

Build a multi-arch image on a Linux machine

Set the following environment variables:

  • Mandatory
    • CLOUDBUILD_PROJECT: the project where you want Cloud Build to run
    • REGION: the region in which Cloud Build will run
    • ZONE: the zone in which Cloud Build will run
  • Optional - If the network and subnetwork are not specified, the default VPC and default subnetwork are used.
    • NETWORK: the network in which the Windows builder VMs will be created (VPC name)
    • SUBNETWORK: the subnetwork in which the Windows builders will be created

Follow the instructions in Building multi-arch images.

If you want to use custom worker pools for Cloud Build (to avoid firewall rules creation for example), set the following environment variables:

  • Mandatory
    • WORKERPOOL: the name of the workerpool
    • WORKERPOOL_REGION: the region of the workerpool
  • Optional
    • USE_INTERNAL_IP: true if the workerpool is connected with a shared VPC to NETWORK

The following are the commands to run a Windows build:

export CLOUDBUILD_PROJECT=CLOUDBUILD_PROJECT
export REGION=REGION
export ZONE=ZONE

skaffold build -d REPOSITORY_PATH

Replace REPOSITORY_PATH with the path to your artifact repository. For example, us-central1-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME.

If you want to build and deploy the container image in the same step, then you can replace the build command with the run command.

Deploy the container image

After the container image is built, use Skaffold to deploy it:

skaffold run -d REPOSITORY_PATH

Replace REPOSITORY_PATH with the path to your artifact repository. For example, us-central1-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME.

What's next