Defined in sandbox.hcl
The container_registry resource configures additional Docker registries for use with image caching and container management. This allows you to authenticate against private registries and configure custom registry endpoints.
resource "container_registry" "private" {
hostname = " my-registry.company.com "
resource "container_registry" "private" {
hostname = " my-registry.company.com "
hostname = " auth.company.com "
username = " service-account "
password = var . registry_password
Fields Field Type Required Description hostnamestring ✓ Hostname of the container registry authblock — Authentication credentials for the registry
Auth container_registry → Auth
Authentication credentials for the registry
Field Type Required Description hostnamestring — Hostname for authentication usernamestring ✓ Username for authentication passwordstring ✓ Password for authentication
Field Type Description meta.idstringFull resource identifier
Authentication configuration for the registry.
Field Type Required Description usernamestring✓ Username for authentication passwordstring✓ Password for authentication hostnamestringHostname for authentication (can differ from registry hostname)
resource "container_registry" "dockerhub" {
hostname = " registry.hub.docker.com "
username = " mydockerhubuser "
password = var . dockerhub_password
resource "container_registry" "corporate" {
hostname = " registry.corp.example.com "
hostname = " auth.corp.example.com "
password = var . corporate_registry_token