Skip to content

Deployment

See Kubernetes Integration for information about deploying to Kubernetes.

Because the output of ko build is an image reference, you can easily pass it to other tools that expect to take an image reference.

docker run

To run the container locally:

docker run -p 8080:8080 $(ko build ./cmd/app)

Google Cloud Run

gcloud run deploy --image=$(ko build ./cmd/app)

💡 Note: The image must be pushed to Google Container Registry or Artifact Registry.


fly.io

flyctl launch --image=$(ko build ./cmd/app)

💡 Note: The image must be pushed to Fly.io's container registry at registry.fly.io, or if not, the image must be publicly available. When pushing to registry.fly.io, you must first log in with flyctl auth docker.


AWS Lambda

aws lambda update-function-code \
  --function-name=my-function-name \
  --image-uri=$(ko build ./cmd/app)

💡 Note: The image must be pushed to ECR, based on the AWS provided base image, and use the aws-lambda-go framework. See official docs for more information.


Azure Container Apps

az containerapp update \
  --name my-container-app
  --resource-group my-resource-group
  --image $(ko build ./cmd/app)

💡 Note: The image must be pushed to ACR or other registry service. See official docs for more information.