Skip to main content
If your base image is hosted in a private registry, you can provide credentials using the following helpers:
  • General registry
  • GCP Artifact Registry
  • AWS ECR

General registry

Template().fromImage('ubuntu:22.04', {
  username: 'user',
  password: 'pass',
})
Template().from_image(
    image="ubuntu:22.04",
    username="user",
    password="pass",
)

GCP Artifact Registry

// From file path
Template().fromGCPRegistry('ubuntu:22.04', {
  serviceAccountJSON: './service_account.json',
})

// From object
Template().fromGCPRegistry('ubuntu:22.04', {
  serviceAccountJSON: { project_id: '123', private_key_id: '456' },
})
# From file path
Template().from_gcp_registry(
    image="ubuntu:22.04",
    service_account_json="./service_account.json",
)

# From object
Template().from_gcp_registry(
    image="ubuntu:22.04",
    service_account_json={"project_id": "123", "private_key_id": "456"},
)

AWS ECR

Template().fromAWSRegistry('ubuntu:22.04', {
  accessKeyId: '123',
  secretAccessKey: '456',
  region: 'us-west-1',
})
Template().from_aws_registry(
    image="ubuntu:22.04",
    access_key_id="123",
    secret_access_key="456",
    region="us-west-1",
)