# Deploy a Linux system container to a target cluster

This page describes how to prepare your cluster for deployment, and how to
deploy your Linux system container using Skaffold.

> [!NOTE]
> **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/).

After you have migrated a workload from your source platform, you can use the
deployment artifacts generated by that process to deploy the migrated workload
container to the cluster.

Skaffold can handle the workflow for building, pushing, and deploying your
application.

## Before you begin

Before deploying your workload, you should have first:

- [Migrated the workload](https://docs.cloud.google.com/migrate/containers/docs/migrating-linux-vm-overview) using Migrate to Containers.
- [Reviewed the generate deployment files](https://docs.cloud.google.com/migrate/containers/docs/review-deployment-files.md.txt).
- Created the cluster where you want to deploy your workload. For more information, see:
  - [Creating a zonal cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-a-zonal-cluster.md.txt)
  - [Creating a regional cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-a-regional-cluster.md.txt)
  - [Creating an Autopilot cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-an-autopilot-cluster.md.txt)
- [Set up `kubectl` and connected to the cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl.md.txt).

## Choose and set up your Docker registry

As part of your deployment, you build and upload the Docker image of your
container to a Docker registry.

For the Docker registry you can choose to use:

- Artifact Registry

- Any Docker registry that supports basic authentication

The recommended solution is to use [Artifact Registry](https://docs.cloud.google.com/artifact-registry)
in the same project of the deployment cluster.
GKE can access the registry by default.
For more information, see the [requirements to integrate with
GKE](https://docs.cloud.google.com/artifact-registry/docs/integrate-gke#requirements).

If you want to use you a private Docker registry, learn
[how to configure the registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).

## Deploy your container with Skaffold

The `skaffold.yaml` file is at the root folder of the generated artifacts.
To learn how to edit the `skaffold.yaml` file, see the
[Skaffold file reference](https://skaffold.dev/docs/references/yaml/).

To build and deploy your container, from the root folder of the generated
artifacts, run the following command:

    skaffold run -d REPOSITORY_PATH

Replace <var translate="no">REPOSITORY_PATH</var> with the path to your artifact repository.
For example,
`us-central1-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME`.

This command builds the image, uploads it to the selected repository,
and then deploys it to the default cluster.

To run Skaffold while building using Cloud Build, use the
following command:

    skaffold run -d REPOSITORY_PATH -p cloudbuild

## What's next

- Learn how to [complete post-migration image updates](https://docs.cloud.google.com/migrate/containers/docs/post-migration-image-updates.md.txt).