Private Docker Registries
A guide to configuring a private container registry for your truss
Truss uses containerized environments to ensure consistent model execution across deployments. When deploying a custom base image or a custom server from a private registry, you must grant Baseten access to download that image.
AWS Elastic Cloud Registry (ECR)
Access Token
- Get the a Base64-encoded secret:
-
Add a new secret to Baseten named
DOCKER_REGISTRY_{aws account id}.dkr.ecr.{us-east-1}.amazonaws.com
with theBase64-encoded secret
as the value. -
Add the secret name to the
secrets
section of theconfig.yaml
to allow this model to access the secret when it is pushed.
Google Cloud Artifact Registry
GCP supports using either access tokens for short lived access or service accounts for container registry authentication.
Service Account
-
Get your service account key as a JSON key blob.
-
Add a new secret to Baseten named
gcp-service-account
(or similar) with the JSON key blob as the value. -
Add the secret name that you used to the
secrets
section of theconfig.yaml
to allow this model to access the secret when it is pushed.
- Configure the
docker_auth
section of yourbase_image:
to ensure that the service account authentication method will be used.
Note that here, secret_name
should match the name of the secret that is contains the JSON key blob.
Access Token
-
Get your access token
-
Add a new secret to Baseten named
DOCKER_REGISTRY_{us-west2}-docker.pkg.dev
with theBase64-encoded secret
as the value. -
Add the secret name to the
secrets
section of theconfig.yaml
to allow this model to access the secret when it is pushed.
Docker Hub
- Get the a Base64-encoded secret:
-
Add a new secret to Baseten named
DOCKER_REGISTRY_https://index.docker.io/v1/
with theBase64-encoded secret
as the value. -
Add the secret name to the
secrets
section of theconfig.yaml
to allow this model to access the secret when it is pushed.
Then, this to config.yaml
:
Was this page helpful?