Deploy a Linux application container

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

Skaffold handles the workflow for building, pushing, and deploying your application. Linux, Tomcat, WebSphere, JBoss, Apache, and WordPress support Skaffold artifact creation by default.

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

Before you begin

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 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.

If you want to use you a private Docker registry, learn how to configure the registry.

Use Skaffold with Linux-based workloads

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.

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

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.

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