Skip to main content
When your base image or referenced container image is hosted on a private registry, you need to provide authentication credentials so fal can pull it. This page covers the setup for Docker Hub, Google Artifact Registry, Amazon ECR, and Azure Container Registry, including how to manage tokens securely using fal’s secrets management. These credentials are passed via the registries parameter on ContainerImage, or under the app’s image.registries configuration in pyproject.toml. In pyproject.toml, this works with both dockerfile and image, and uses the same shape: registry host to username and password. Each registry uses a different authentication method, so follow the section below that matches your registry provider. A password written as $SECRET_NAME references the fal secret of that name. If your actual password starts with a $, escape it as $$ (for example, write $$abc for the literal password $abc).

Dockerhub

The same Docker Hub credentials can be configured in pyproject.toml:

Google Artifact Registry

We recommend using a service account and setting a base64-encoded version of the key as a fal secret.
1

Create a JSON key for a service account.

Download the key file to your local machine.
2

Encode the key in base64.

3

Set the result as a fal secret.

4

Use the secret in your code.

The same service account credentials can be configured in pyproject.toml:

Amazon Elastic Container Registry (ECR)

ECR tokens expire every 12 hours. It’s best to auto-generate one on the fly using boto3 and your AWS credentials.
When using pyproject.toml, generate the ECR password outside the config and store it as a fal secret. For example, with an authenticated AWS CLI:
Refresh this secret when the ECR password expires:

Azure Container Registry (ACR)

We recommend using a service principal with the AcrPull role. Unlike ECR there is no short-lived token to refresh. Note that service principal passwords created by az ad sp create-for-rbac are valid for 1 year by default (pass --years to adjust), so update the fal secret when you rotate the credential.
1

Create a service principal with pull access to your registry.

Note the appId and password from the output.
2

Set the password as a fal secret.

Quote the value: service principal passwords often contain characters your shell would otherwise interpret.
3

Use the secret in your code.

A repository-scoped ACR token or the registry’s admin user also work as the username/password pair. Avoid pasting the output of az acr login --expose-token, since those Entra ID access tokens expire after a few hours. The same service principal credentials can be configured in pyproject.toml: