Container registries
Create a Secret for securing container registry (Docker) credentials used to pull private images
Use this Secret when a Workflow, Service, Worker, or App needs to pull a container image from a private registry (for example, Docker Hub, AWS ECR, GCP Artifact Registry, or a self-hosted registry). The Secret stores the registry authentication in the same format as a Docker config.json, and is referenced by name from the consuming Resource's imagePullSecret field.
Prerequisites
To create a Secret for securing container registry credentials, you need the following information from your registry.
Source system requirements
Registry server: the registry hostname (for example,
https://index.docker.io/v1/for Docker Hub, or<account>.dkr.ecr.<region>.amazonaws.comfor AWS ECR).Username and Password (or token): credentials DataOS uses to authenticate with the registry.
auth: base64 encoding of
username:password. Most registries read this field first, so leaving it empty can cause the pull to fail even ifusername/passwordare filled in.
Get these credentials from the registry provider's account settings, or from an administrator.
Create a Secret to secure container registry credentials
Step 1: Create a manifest file
Create a manifest file with the configuration details for your container registry Secret.
name: ${{secret-name}}
version: v2alpha
type: secret
tags:
- ${{tag-1}}
- ${{tag-2}}
description: ${{secret-description}}
owner: ${{owner-id}}
secret:
type: image-pull
data:
.dockerconfigjson: |
{
"auths": {
"${{registry-server}}": {
"auth": "${{base64-of-username:password}}",
"username": "${{username}}",
"password": "${{password}}"
}
}
}For more information about each attribute, refer to the configurations section.
Step 2: Apply the manifest
Use the apply command to create the container registry Secret in DataOS.
Example usage:
Step 3: Validate the Secret
Use the get command to verify the Secret in DataOS.
Expected output:
Consume the Secret
Reference the Secret by name from spec.service.imagePullSecret in the Resource that needs to pull the private image (for example, an App):
See Deploy a data application for the full App manifest.
Delete the Secret
To delete the container registry Secret, use one of the following commands:
Example usage:
Last updated
Was this helpful?